Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikic
llvm-wrapper: adapt for LLVM API changes
No functional changes intended.
Updates the wrapper for 21eddfac3d
.
````@rustbot```` label: +llvm-main
r? ````@nikic````
This commit is contained in:
commit
8c7a7e346b
1 changed files with 7 additions and 3 deletions
|
@ -1212,7 +1212,11 @@ struct LLVMRustThinLTOData {
|
||||||
// Not 100% sure what these are, but they impact what's internalized and
|
// Not 100% sure what these are, but they impact what's internalized and
|
||||||
// what's inlined across modules, I believe.
|
// what's inlined across modules, I believe.
|
||||||
#if LLVM_VERSION_GE(18, 0)
|
#if LLVM_VERSION_GE(18, 0)
|
||||||
|
#if LLVM_VERSION_GE(20, 0)
|
||||||
|
FunctionImporter::ImportListsTy ImportLists;
|
||||||
|
#else
|
||||||
DenseMap<StringRef, FunctionImporter::ImportMapTy> ImportLists;
|
DenseMap<StringRef, FunctionImporter::ImportMapTy> ImportLists;
|
||||||
|
#endif
|
||||||
DenseMap<StringRef, FunctionImporter::ExportSetTy> ExportLists;
|
DenseMap<StringRef, FunctionImporter::ExportSetTy> ExportLists;
|
||||||
DenseMap<StringRef, GVSummaryMapTy> ModuleToDefinedGVSummaries;
|
DenseMap<StringRef, GVSummaryMapTy> ModuleToDefinedGVSummaries;
|
||||||
#else
|
#else
|
||||||
|
@ -1421,13 +1425,13 @@ LLVMRustPrepareThinLTOInternalize(const LLVMRustThinLTOData *Data,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" bool LLVMRustPrepareThinLTOImport(const LLVMRustThinLTOData *Data,
|
extern "C" bool LLVMRustPrepareThinLTOImport(LLVMRustThinLTOData *Data,
|
||||||
LLVMModuleRef M,
|
LLVMModuleRef M,
|
||||||
LLVMTargetMachineRef TM) {
|
LLVMTargetMachineRef TM) {
|
||||||
Module &Mod = *unwrap(M);
|
Module &Mod = *unwrap(M);
|
||||||
TargetMachine &Target = *unwrap(TM);
|
TargetMachine &Target = *unwrap(TM);
|
||||||
|
|
||||||
const auto &ImportList = Data->ImportLists.lookup(Mod.getModuleIdentifier());
|
const auto &ImportList = Data->ImportLists[Mod.getModuleIdentifier()];
|
||||||
auto Loader = [&](StringRef Identifier) {
|
auto Loader = [&](StringRef Identifier) {
|
||||||
const auto &Memory = Data->ModuleMap.lookup(Identifier);
|
const auto &Memory = Data->ModuleMap.lookup(Identifier);
|
||||||
auto &Context = Mod.getContext();
|
auto &Context = Mod.getContext();
|
||||||
|
@ -1610,7 +1614,7 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
|
||||||
LLVMRustThinLTOData *Data) {
|
LLVMRustThinLTOData *Data) {
|
||||||
SmallString<40> Key;
|
SmallString<40> Key;
|
||||||
llvm::lto::Config conf;
|
llvm::lto::Config conf;
|
||||||
const auto &ImportList = Data->ImportLists.lookup(ModId);
|
const auto &ImportList = Data->ImportLists[ModId];
|
||||||
const auto &ExportList = Data->ExportLists.lookup(ModId);
|
const auto &ExportList = Data->ExportLists.lookup(ModId);
|
||||||
const auto &ResolvedODR = Data->ResolvedODR.lookup(ModId);
|
const auto &ResolvedODR = Data->ResolvedODR.lookup(ModId);
|
||||||
const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(ModId);
|
const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(ModId);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue