Update thinLTOInternalizeAndPromoteInIndex() usage
This commit is contained in:
parent
30ec68a545
commit
8010f4037a
1 changed files with 10 additions and 0 deletions
|
@ -962,6 +962,15 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
|
||||||
ExportedGUIDs.insert(GUID);
|
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) {
|
auto isExported = [&](StringRef ModuleIdentifier, GlobalValue::GUID GUID) {
|
||||||
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
|
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
|
||||||
return (ExportList != Ret->ExportLists.end() &&
|
return (ExportList != Ret->ExportLists.end() &&
|
||||||
|
@ -969,6 +978,7 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
|
||||||
ExportedGUIDs.count(GUID);
|
ExportedGUIDs.count(GUID);
|
||||||
};
|
};
|
||||||
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported);
|
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported);
|
||||||
|
#endif
|
||||||
|
|
||||||
return Ret.release();
|
return Ret.release();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue