Skip to content

Commit 85f29bd

Browse files
tmandrycuviper
authored andcommitted
Revert "Rollup merge of rust-lang#129749 - krasimirgg:llvm-20-lto, r=nikic"
This reverts commit 8c7a7e3, reversing changes made to a00bd75. (cherry picked from commit 472fef6)
1 parent f004b77 commit 85f29bd

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)