[PATCH] D15084: Split the linker in 2

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 13:42:20 PST 2015


> +  void addLazyFor(GlobalValue &GV, IRMover::ValueAdder Add);
>    bool shouldOverrideFromSrc() { return Flags & Linker::OverrideFromSrc; }
> ----------------
> Add doxygen comment

Will do.

> ================
> Comment at: lib/Linker/LinkModules.cpp:664
> @@ +663,3 @@
> +  // Add these to the internalize list
> +  if (!GV.hasLinkOnceLinkage())
> +    return;
> ----------------
> Is link once the only type we need to add support for linking lazily? If not, the Add(GV) call needs to move up above this check.

Note that the predicate cover linkonce and linkonce_odr. They are the
only linker visible GVs that can be dropped, so yes, I think they are
the only ones we have to ask.

> Below when looking at the comdat members you are checking for !hasLocalLinkage(). Is it legal that some comdat members could be link once and others not?
>

Sure. What is illegal on ELF is for there to be a reference from
outside a comdat to local symbol inside a comdat.

Cheers,
Rafael


More information about the llvm-commits mailing list