llvm-wrapper: adapt for LLVM API change

Adapts the wrapper for the LLVM commit 377e1311d5.
This commit is contained in:
Krasimir Georgiev 2023-03-27 11:12:47 +00:00
parent 7a0600714a
commit 684e7a5461

View File

@ -1158,13 +1158,6 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
// Otherwise, we sometimes lose `static` values -- see #60184. // Otherwise, we sometimes lose `static` values -- see #60184.
computeDeadSymbolsWithConstProp(Ret->Index, Ret->GUIDPreservedSymbols, computeDeadSymbolsWithConstProp(Ret->Index, Ret->GUIDPreservedSymbols,
deadIsPrevailing, /* ImportEnabled = */ false); deadIsPrevailing, /* ImportEnabled = */ false);
ComputeCrossModuleImport(
Ret->Index,
Ret->ModuleToDefinedGVSummaries,
Ret->ImportLists,
Ret->ExportLists
);
// Resolve LinkOnce/Weak symbols, this has to be computed early be cause it // Resolve LinkOnce/Weak symbols, this has to be computed early be cause it
// impacts the caching. // impacts the caching.
// //
@ -1181,6 +1174,16 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
return true; return true;
return Prevailing->second == S; return Prevailing->second == S;
}; };
ComputeCrossModuleImport(
Ret->Index,
Ret->ModuleToDefinedGVSummaries,
#if LLVM_VERSION_GE(17, 0)
isPrevailing,
#endif
Ret->ImportLists,
Ret->ExportLists
);
auto recordNewLinkage = [&](StringRef ModuleIdentifier, auto recordNewLinkage = [&](StringRef ModuleIdentifier,
GlobalValue::GUID GUID, GlobalValue::GUID GUID,
GlobalValue::LinkageTypes NewLinkage) { GlobalValue::LinkageTypes NewLinkage) {