[PATCH] D13515: Support for ThinLTO function importing and symbol linking.

Tobias Edler von Koch via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 13:40:10 PDT 2015


tobiasvk added a subscriber: tobiasvk.

================
Comment at: lib/Linker/LinkModules.cpp:676
@@ +675,3 @@
+  // can simply use the clone created in this module.
+  if (GVar && GVar->isConstant()) return false;
+  return true;
----------------
tejohnson wrote:
> davidxl wrote:
> > Unless the address taken bit is set (to handle the case address is used in comparison).
> Good catch. And unfortunately for GVars there is no address taken bit or easy check for this. For functions, there is a hasAddressTaken function that walks the uses, but not for GVars. But that isn't useful here in the importing context in any case, since we haven't even parsed all of the functions where it may be address taken. It will have to be recorded in the function index in the front end. For now I will simply promote all locals (and leave a comment about what would need to be done to reduce this scope).
Could you use the unnamed_addr bit?


http://reviews.llvm.org/D13515





More information about the llvm-commits mailing list