[PATCH] D18674: [ThinLTO/gold] Change preempted def to avail extern linkage when possible

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 13:49:12 PDT 2016


On 5 April 2016 at 16:46, Teresa Johnson <tejohnson at google.com> wrote:
> tejohnson added inline comments.
>
> ================
> Comment at: tools/gold/gold-plugin.cpp:779
> @@ +778,3 @@
> +      // FIXME: For can preempted Comdat members be dropped from their
> +      // Comdat so they can use available_externally linkage?
> +      if (options::thinlto && !GV->hasComdat() &&
> ----------------
> rafael wrote:
>> It is OK to have available_externally to a comdat member, no?
>>
>> I mean, it is equivalent to a declaration, and we can have a declaration to a comdat member.
> You can't have a declaration or available_externally in a comdat. From Verifier.cpp:
>
>   if (GV.isDeclarationForLinker())
>     Assert(!GV.hasComdat(), "Declaration may not be in a Comdat!", &GV);

Yes, what I mean is that is valid to have a declaration that points to
something in a  comdat. That is what you get in c++ with an explicit
template instantiation declaration.

Cheers,
Rafael


More information about the llvm-commits mailing list