[PATCH] D18252: Drop comdats from the dst module if they are not selected

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 10:11:00 PDT 2016


tejohnson added inline comments.

================
Comment at: lib/Linker/LinkModules.cpp:477
@@ +476,3 @@
+    PointerType &Ty = *cast<PointerType>(Alias.getType());
+    GlobalValue::LinkageTypes L = Alias.getLinkage();
+    GlobalValue *Declaration =
----------------
tejohnson wrote:
> nit: just invoke Alias.getLinkage() in below constructor call and remove local L.
> 
> Also is it even correct to use the original linkage as-is in all cases? Should it be ExternalLinkage?
> 
> Finally, what if this is ThinLTO and the alias was defined in the original module we are importing into? Won't we have an undef at link time? Ditto for full LTO - where would this new declaration be defined? I'm not even sure what the right behavior is in that case.
> Finally, what if this is ThinLTO and the alias was defined in the original module we are importing into? Won't we have an undef at link time? Ditto for full LTO - where would this new declaration be defined? I'm not even sure what the right behavior is in that case.

Should the original dest aliasee simply be removed from the comdat, renamed if necessary, and the alias still use it?

Otherwise it isn't clear to me where these are being defined.


http://reviews.llvm.org/D18252





More information about the llvm-commits mailing list