]> granicus.if.org Git - llvm/commitdiff
[lib/LTO] Add a comment to explain where we set the linkage in the summary.
authorDavide Italiano <davide@freebsd.org>
Thu, 6 Jul 2017 20:04:20 +0000 (20:04 +0000)
committerDavide Italiano <davide@freebsd.org>
Thu, 6 Jul 2017 20:04:20 +0000 (20:04 +0000)
Pointed out by Teresa!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307305 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/FunctionImport.cpp

index 5e7cf436e2e3fabc8e4446737bce369899f56f6d..c89e0e8e1bf5f53e4946ebbdee46ef04387d9eb4 100644 (file)
@@ -547,6 +547,11 @@ void llvm::thinLTOResolveWeakForLinkerModule(
 
     // 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;