[llvm-commits] [llvm] r107205 - in /llvm/trunk: bindings/ada/llvm/ docs/ include/llvm-c/ include/llvm/ include/llvm/CodeGen/ include/llvm/MC/ include/llvm/Target/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/Linker/ lib/MC/ lib/Target/ lib/Target/CppBackend/ lib/Target/XCore/AsmPrinter/ lib/Transforms/IPO/ lib/VMCore/ tools/llvm-nm/

Bill Wendling isanbard at gmail.com
Wed Jun 30 10:49:42 PDT 2010


On Jun 30, 2010, at 8:24 AM, Chris Lattner wrote:

> On Jun 29, 2010, at 3:33 PM, Bill Wendling wrote:
> 
>> On Jun 29, 2010, at 2:56 PM, Chris Lattner wrote:
>> 
>>> On Jun 29, 2010, at 2:24 PM, Bill Wendling wrote:
>>> 
>>>> Author: void
>>>> Date: Tue Jun 29 16:24:00 2010
>>>> New Revision: 107205
>>>> 
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=107205&view=rev
>>>> Log:
>>>> Introducing the "linker_weak" linkage type. This will be used for Objective-C
>>>> metadata types which should be marked as "weak", but which the linker will
>>>> remove upon final linkage.
>>> 
>>> Hi Bill,
>>> 
>>> This would have been good to talk about before you implemented it.  The name linker_weak doesn't seem very descriptive.  How about linker_private_weak or something like that?
>>> 
>> I thought about that, but they aren't private from what I can tell. They're marked as ".globl" and ".weak_definition".
> 
> They are "as private" as other "l" labels, right?  Those are visible across translation units too.  We call it "linker private" so calling this "linker_private_weak" seems reasonable.  Any other suggestions?

"linker_private_weak" is fine. (I'm not a huge fan of it because we don't have an analogous non-linker linkage. I.e., we don't have a "private_weak" type that corresponds with it.)

>>> Please make this "HasLinkerPrivateWeakLinkage".  There is only one target with this linkage form and it always spells it the same way.  Predicating stuff based on the bool is more clean considering that the *name* is the same as LinkerPrivate the linkage semantics require a new *directive* to be emitted.
>>> 
>>> In fact, I don't think you actually need this bit at all since asmprinter handles these symbols like all the other .weak stuff.  Is it needed?
>>> 
>> I'll check to see if it's used. If it's not used, then it's relying upon the hack down below, which is bad. However, I much prefer having the prefix string in one place than relying upon it being buried in some deep part of the asm printer.
> 
> I don't really understand what you mean.
> 
I want to separate it out from the "linker_private" linkage. In particular, I don't want to say that it will always have the same prefix as linker_private. That's the case with Darwin, but I don't see why that has to be the case for every linker that would want to implement it.

-bw





More information about the llvm-commits mailing list