@@ -1212,11 +1212,7 @@ struct LLVMRustThinLTOData {
1212
1212
// Not 100% sure what these are, but they impact what's internalized and
1213
1213
// what's inlined across modules, I believe.
1214
1214
#if LLVM_VERSION_GE(18, 0)
1215
- #if LLVM_VERSION_GE(20, 0)
1216
- FunctionImporter::ImportListsTy ImportLists;
1217
- #else
1218
1215
DenseMap<StringRef, FunctionImporter::ImportMapTy> ImportLists;
1219
- #endif
1220
1216
DenseMap<StringRef, FunctionImporter::ExportSetTy> ExportLists;
1221
1217
DenseMap<StringRef, GVSummaryMapTy> ModuleToDefinedGVSummaries;
1222
1218
#else
@@ -1425,13 +1421,13 @@ LLVMRustPrepareThinLTOInternalize(const LLVMRustThinLTOData *Data,
1425
1421
return true ;
1426
1422
}
1427
1423
1428
- extern " C" bool LLVMRustPrepareThinLTOImport (LLVMRustThinLTOData *Data,
1424
+ extern " C" bool LLVMRustPrepareThinLTOImport (const LLVMRustThinLTOData *Data,
1429
1425
LLVMModuleRef M,
1430
1426
LLVMTargetMachineRef TM) {
1431
1427
Module &Mod = *unwrap (M);
1432
1428
TargetMachine &Target = *unwrap (TM);
1433
1429
1434
- const auto &ImportList = Data->ImportLists [ Mod.getModuleIdentifier ()] ;
1430
+ const auto &ImportList = Data->ImportLists . lookup ( Mod.getModuleIdentifier ()) ;
1435
1431
auto Loader = [&](StringRef Identifier) {
1436
1432
const auto &Memory = Data->ModuleMap .lookup (Identifier);
1437
1433
auto &Context = Mod.getContext ();
@@ -1614,7 +1610,7 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
1614
1610
LLVMRustThinLTOData *Data) {
1615
1611
SmallString<40 > Key;
1616
1612
llvm::lto::Config conf;
1617
- const auto &ImportList = Data->ImportLists [ ModId] ;
1613
+ const auto &ImportList = Data->ImportLists . lookup ( ModId) ;
1618
1614
const auto &ExportList = Data->ExportLists .lookup (ModId);
1619
1615
const auto &ResolvedODR = Data->ResolvedODR .lookup (ModId);
1620
1616
const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries .lookup (ModId);
0 commit comments