@@ -1212,11 +1212,7 @@ struct LLVMRustThinLTOData {
12121212 // Not 100% sure what these are, but they impact what's internalized and
12131213 // what's inlined across modules, I believe.
12141214#if LLVM_VERSION_GE(18, 0)
1215- #if LLVM_VERSION_GE(20, 0)
1216- FunctionImporter::ImportListsTy ImportLists;
1217- #else
12181215 DenseMap<StringRef, FunctionImporter::ImportMapTy> ImportLists;
1219- #endif
12201216 DenseMap<StringRef, FunctionImporter::ExportSetTy> ExportLists;
12211217 DenseMap<StringRef, GVSummaryMapTy> ModuleToDefinedGVSummaries;
12221218#else
@@ -1425,13 +1421,13 @@ LLVMRustPrepareThinLTOInternalize(const LLVMRustThinLTOData *Data,
14251421 return true ;
14261422}
14271423
1428- extern " C" bool LLVMRustPrepareThinLTOImport (LLVMRustThinLTOData *Data,
1424+ extern " C" bool LLVMRustPrepareThinLTOImport (const LLVMRustThinLTOData *Data,
14291425 LLVMModuleRef M,
14301426 LLVMTargetMachineRef TM) {
14311427 Module &Mod = *unwrap (M);
14321428 TargetMachine &Target = *unwrap (TM);
14331429
1434- const auto &ImportList = Data->ImportLists [ Mod.getModuleIdentifier ()] ;
1430+ const auto &ImportList = Data->ImportLists . lookup ( Mod.getModuleIdentifier ()) ;
14351431 auto Loader = [&](StringRef Identifier) {
14361432 const auto &Memory = Data->ModuleMap .lookup (Identifier);
14371433 auto &Context = Mod.getContext ();
@@ -1614,7 +1610,7 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
16141610 LLVMRustThinLTOData *Data) {
16151611 SmallString<40 > Key;
16161612 llvm::lto::Config conf;
1617- const auto &ImportList = Data->ImportLists [ ModId] ;
1613+ const auto &ImportList = Data->ImportLists . lookup ( ModId) ;
16181614 const auto &ExportList = Data->ExportLists .lookup (ModId);
16191615 const auto &ResolvedODR = Data->ResolvedODR .lookup (ModId);
16201616 const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries .lookup (ModId);
0 commit comments