diff options
-rw-r--r-- | lib/LTO/LTO.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp index 4e33018e78e..6ca7e34527c 100644 --- a/lib/LTO/LTO.cpp +++ b/lib/LTO/LTO.cpp @@ -971,7 +971,8 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache, // IRName will be defined if we have seen the prevailing copy of // this value. If not, no need to preserve any ThinLTO copies. !Res.second.IRName.empty()) - GUIDPreservedSymbols.insert(GlobalValue::getGUID(Res.second.IRName)); + GUIDPreservedSymbols.insert(GlobalValue::getGUID( + GlobalValue::getRealLinkageName(Res.second.IRName))); } auto DeadSymbols = @@ -990,10 +991,11 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache, // partition (and we can't get the GUID). if (Res.second.IRName.empty()) continue; - auto GUID = GlobalValue::getGUID(Res.second.IRName); + auto GUID = GlobalValue::getGUID( + GlobalValue::getRealLinkageName(Res.second.IRName)); // Mark exported unless index-based analysis determined it to be dead. if (!DeadSymbols.count(GUID)) - ExportedGUIDs.insert(GlobalValue::getGUID(Res.second.IRName)); + ExportedGUIDs.insert(GUID); } auto isPrevailing = [&](GlobalValue::GUID GUID, |