[PATCH] D19308: ThinLTO: Resolve linkonce_odr aliases just like functions

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 12:13:04 PDT 2016


joker.eph added inline comments.

================
Comment at: lib/LTO/ThinLTOCodeGenerator.cpp:161
@@ +160,3 @@
+      // Alias can't be turned into available_externally.
+      return OriginalLinkage;
+    return GlobalValue::AvailableExternallyLinkage;
----------------
tejohnson wrote:
> Since this is a variant of similar handling that used to be here for the aliasee in D19096 (since removed), I will copy over a variant of my suggestion from back then:
> 
> I think it would be helpful to add a comment here about how this works. I.e. something like "If a non-imported alias that remains linkonce is referenced by an imported function, the IRMover will create a corresponding ExternalLinkage declaration, which will be satisfied at link time with the copy that was resolved to WeakODR."
Your sentence is not clear to me, I'm not sure if I misunderstand because it does not seems to apply.  See also line 170 for the general explanation that seems to cover what happens here (nothing is really specific to alias for the resolution).

The only specificity here with alias is we can't turn them into available_externally.
We turn ODR functions (even if they have a callee remaining in the current module) into available externally to *force* dropping them.





http://reviews.llvm.org/D19308





More information about the llvm-commits mailing list