Skip to content

Commit

Permalink
Update thinLTOInternalizeAndPromoteInIndex() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jan 7, 2020
1 parent 30ec68a commit 8010f40
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/rustllvm/PassWrapper.cpp
Expand Up @@ -962,13 +962,23 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
ExportedGUIDs.insert(GUID);
}
}
#if LLVM_VERSION_GE(10, 0)
auto isExported = [&](StringRef ModuleIdentifier, ValueInfo VI) {
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
return (ExportList != Ret->ExportLists.end() &&
ExportList->second.count(VI)) ||
ExportedGUIDs.count(VI.getGUID());
};
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported, isPrevailing);
#else
auto isExported = [&](StringRef ModuleIdentifier, GlobalValue::GUID GUID) {
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
return (ExportList != Ret->ExportLists.end() &&
ExportList->second.count(GUID)) ||
ExportedGUIDs.count(GUID);
};
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported);
#endif

return Ret.release();
}
Expand Down

0 comments on commit 8010f40

Please sign in to comment.