[llvm] r307305 - [lib/LTO] Add a comment to explain where we set the linkage in the summary.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 13:04:21 PDT 2017


Author: davide
Date: Thu Jul  6 13:04:20 2017
New Revision: 307305

URL: http://llvm.org/viewvc/llvm-project?rev=307305&view=rev
Log:
[lib/LTO] Add a comment to explain where we set the linkage in the summary.

Pointed out by Teresa!

Modified:
    llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp

Modified: llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp?rev=307305&r1=307304&r2=307305&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp Thu Jul  6 13:04:20 2017
@@ -547,6 +547,11 @@ void llvm::thinLTOResolveWeakForLinkerMo
 
     // Switch the linkage to weakany if asked for, e.g. we do this for
     // linker redefined symbols (via --wrap or --defsym).
+    // We record that the visibility should be changed here in `addThinLTO`
+    // as we need access to the resolution vectors for each input file in
+    // order to find which symbols have been redefined.
+    // We may consider reorganizing this code and moving the linkage recording
+    // somewhere else, e.g. in thinLTOResolveWeakForLinkerInIndex.
     if (NewLinkage == GlobalValue::WeakAnyLinkage) {
       GV.setLinkage(NewLinkage);
       return;




More information about the llvm-commits mailing list