Skip to content

Commit 9014537

Browse files
committed
Update thinLTOInternalizeAndPromoteInIndex() usage
1 parent 01f4ea9 commit 9014537

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
@@ -958,13 +958,23 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
958958
ExportedGUIDs.insert(GUID);
959959
}
960960
}
961+
#if LLVM_VERSION_GE(10, 0)
962+
auto isExported = [&](StringRef ModuleIdentifier, ValueInfo VI) {
963+
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
964+
return (ExportList != Ret->ExportLists.end() &&
965+
ExportList->second.count(VI)) ||
966+
ExportedGUIDs.count(VI.getGUID());
967+
};
968+
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported, isPrevailing);
969+
#else
961970
auto isExported = [&](StringRef ModuleIdentifier, GlobalValue::GUID GUID) {
962971
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
963972
return (ExportList != Ret->ExportLists.end() &&
964973
ExportList->second.count(GUID)) ||
965974
ExportedGUIDs.count(GUID);
966975
};
967976
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported);
977+
#endif
968978

969979
return Ret.release();
970980
}

0 commit comments

Comments
 (0)