[LLVMdev] Moving Private Label Prefixes from MCAsmInfo to MCObjectFileInfo

Daniel Sanders
2015-05-21T15:40:58Z

Hi,

I've been having trouble properly resolving an issue with our assembly
syntax. The prefix our assembler uses for private local/global labels depends on
the object file format. For ELF32 they begin with '$' and for ELF64 they
begin with '.L'. The object file format depends on the ABI, but multiple
ABI's are usable with the same target triple so we can't select between
the prefixes using triples. In the current structure, we appear to need
MCAsmInfo to return different values for different object formats but it has no
means to do this.

It seems to me that the private label prefixes are more closely associated with
the object file format than they are with the assembly syntax so I'd like to
propose moving
MCAsmInfo::getPrivateGlobalPrefix(), MCAsmInfo::getPrivateLabelPrefix(), and
MCAsmInfo::getLinkerPrivateGlobalPrefix() to MCObjectFileInfo and its
subclasses. This fixes the Mips case and should have no noticeable impact on
other targets. ARM will need some new MCObjectFileInfo classes to handle COFF
but other than that, the change seems fairly simple.

Does anyone agree/disagree with this change? Have I missed anything?

Daniel Sanders
Leading Software Design Engineer, MIPS Processor IP
Imagination Technologies Limited
www.imgtec.com<http://www.imgtec.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20150521/3b248fa4/attachment.html>