From 78be03e359860f77e327d9db9f72084c1437280b Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Thu, 6 Jul 2017 20:04:20 +0000 Subject: [PATCH] [lib/LTO] Add a comment to explain where we set the linkage in the summary. 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Transforms/IPO/FunctionImport.cpp b/lib/Transforms/IPO/FunctionImport.cpp index 5e7cf436e2e..c89e0e8e1bf 100644 --- a/lib/Transforms/IPO/FunctionImport.cpp +++ b/lib/Transforms/IPO/FunctionImport.cpp @@ -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; -- 2.40.0