@@ -1205,7 +1205,11 @@ struct LLVMRustThinLTOData {
12051205 // Not 100% sure what these are, but they impact what's internalized and
12061206 // what's inlined across modules, I believe.
12071207#if LLVM_VERSION_GE(18, 0)
1208+ #if LLVM_VERSION_GE(20, 0)
1209+ FunctionImporter::ImportListsTy ImportLists;
1210+ #else
12081211 DenseMap<StringRef, FunctionImporter::ImportMapTy> ImportLists;
1212+ #endif
12091213 DenseMap<StringRef, FunctionImporter::ExportSetTy> ExportLists;
12101214 DenseMap<StringRef, GVSummaryMapTy> ModuleToDefinedGVSummaries;
12111215#else
@@ -1414,13 +1418,13 @@ LLVMRustPrepareThinLTOInternalize(const LLVMRustThinLTOData *Data,
14141418 return true ;
14151419}
14161420
1417- extern " C" bool LLVMRustPrepareThinLTOImport (const LLVMRustThinLTOData *Data,
1421+ extern " C" bool LLVMRustPrepareThinLTOImport (LLVMRustThinLTOData *Data,
14181422 LLVMModuleRef M,
14191423 LLVMTargetMachineRef TM) {
14201424 Module &Mod = *unwrap (M);
14211425 TargetMachine &Target = *unwrap (TM);
14221426
1423- const auto &ImportList = Data->ImportLists . lookup ( Mod.getModuleIdentifier ()) ;
1427+ const auto &ImportList = Data->ImportLists [ Mod.getModuleIdentifier ()] ;
14241428 auto Loader = [&](StringRef Identifier) {
14251429 const auto &Memory = Data->ModuleMap .lookup (Identifier);
14261430 auto &Context = Mod.getContext ();
@@ -1603,7 +1607,7 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
16031607 LLVMRustThinLTOData *Data) {
16041608 SmallString<40 > Key;
16051609 llvm::lto::Config conf;
1606- const auto &ImportList = Data->ImportLists . lookup ( ModId) ;
1610+ const auto &ImportList = Data->ImportLists [ ModId] ;
16071611 const auto &ExportList = Data->ExportLists .lookup (ModId);
16081612 const auto &ResolvedODR = Data->ResolvedODR .lookup (ModId);
16091613 const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries .lookup (ModId);
0 commit comments