[llvm-commits] [llvm] r75619 - in /llvm/trunk/lib: CodeGen/AsmPrinter/AsmPrinter.cpp Target/DarwinTargetAsmInfo.cpp
Chris Lattner
clattner at apple.com
Fri Jul 17 17:15:49 PDT 2009
On Jul 17, 2009, at 3:35 PM, Dale Johannesen wrote:
> On Jul 17, 2009, at 3:05 PMPDT, Chris Lattner wrote:
> On Jul 14, 2009, at 9:56 AM, Dale Johannesen wrote:
>>>>>> getValueName(GV).substr(0,strlen(getLessPrivateGlobalPrefix()))
>>>>>> ==
>>>>> + Mang->getMangledName(GV).substr(0,
>>>>> +
>>>>> strlen(getLessPrivateGlobalPrefix())) ==
>>>>> getLessPrivateGlobalPrefix())))
>>>>
>>>> Dale, I think you added "less private global". Do you remember?
>>>
>>> Only what's in the comment:
>>> /// LessPrivateGlobalPrefix - This prefix is used for symbols
>>> that should
>>> /// be passed through the assembler but be removed by the
>>> linker. This
>>> /// is "l" on Darwin, currently used for some ObjC metadata.
>>
>> Dale, I see a series of commits where this code was added, refined,
>> etc, culimating in this specific patch:
>> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080908/066962.html
>
> There's some later messages which talk about this. The first one
> has an example. There was originally a radar but I think the first
> message is more helpful.
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080908/066985.html
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080908/067012.html
This is a really unfortunate way to do this. I filed rdar://7071300
to track this work, but it has several dependencies. In particular,
we need to introduce a new llvm.used.assembler directive, which is
just like llvm.used, but doesn't cause .no_dead_strip to get emitted.
We need to add a new linkage type corresponding to "l" labels in
darwin, which itself would be a huge cleanup, then we need to switch
clang/llvm-gcc to work with this.
I don't want to lose this, but I don't have time to tackle it right now.
>> Unfortunately there are no testcases and I have no idea why this
>> stuff is being done. Can you explain it?
>>
>> I think this is really the wrong way to handle this. It add a
>> bunch of ad-hoc hooks and the code in
>> DarwinTargetAsmInfo::emitUsedDirectiveFor (besides being a very
>> misleading name for the hook) is gross string manipulation that
>> should not happen in the code generator like that.
>
> Patches welcome! I'm certainly not wedded to the current approach
> or the name (I don't like the name either, just couldn't think of
> anything better).
I will rename this. The name implies it actually emits something.
-Chris
More information about the llvm-commits
mailing list