Skip to content

Commit 8010f40

Browse files
committed
Update thinLTOInternalizeAndPromoteInIndex() usage
1 parent 30ec68a commit 8010f40

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/rustllvm/PassWrapper.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,13 +962,23 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
962962
ExportedGUIDs.insert(GUID);
963963
}
964964
}
965+
#if LLVM_VERSION_GE(10, 0)
966+
auto isExported = [&](StringRef ModuleIdentifier, ValueInfo VI) {
967+
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
968+
return (ExportList != Ret->ExportLists.end() &&
969+
ExportList->second.count(VI)) ||
970+
ExportedGUIDs.count(VI.getGUID());
971+
};
972+
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported, isPrevailing);
973+
#else
965974
auto isExported = [&](StringRef ModuleIdentifier, GlobalValue::GUID GUID) {
966975
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
967976
return (ExportList != Ret->ExportLists.end() &&
968977
ExportList->second.count(GUID)) ||
969978
ExportedGUIDs.count(GUID);
970979
};
971980
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported);
981+
#endif
972982

973983
return Ret.release();
974984
}

0 commit comments

Comments
 (0)