about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-17 19:37:03 +0000
committerbors <bors@rust-lang.org>2024-09-17 19:37:03 +0000
commit28e8f01c2a2f33fb4214925a704e3223b372cad5 (patch)
tree22d177677f08688b0bc6d7a5bcce29f61c098b1a /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parentf609b7e0586f81fefb3523e3e17adf779ac416be (diff)
parentf8090dda64203c24713ff66849b49a9d92557ee6 (diff)
downloadrust-28e8f01c2a2f33fb4214925a704e3223b372cad5.tar.gz
rust-28e8f01c2a2f33fb4214925a704e3223b372cad5.zip
Auto merge of #130483 - matthiaskrgr:rollup-q1r0g0y, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #129477 (Fix fluent diagnostics)
 - #129674 (Add new_cyclic_in for Rc and Arc)
 - #130452 (Update Trusty target maintainers)
 - #130467 (Miri subtree update)
 - #130477 (Revert #129749 to fix segfault in LLVM)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index 74d9e02cc2f..4a4ba165b57 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -1211,11 +1211,7 @@ struct LLVMRustThinLTOData {
   // Not 100% sure what these are, but they impact what's internalized and
   // what's inlined across modules, I believe.
 #if LLVM_VERSION_GE(18, 0)
-#if LLVM_VERSION_GE(20, 0)
-  FunctionImporter::ImportListsTy ImportLists;
-#else
   DenseMap<StringRef, FunctionImporter::ImportMapTy> ImportLists;
-#endif
   DenseMap<StringRef, FunctionImporter::ExportSetTy> ExportLists;
   DenseMap<StringRef, GVSummaryMapTy> ModuleToDefinedGVSummaries;
 #else
@@ -1424,13 +1420,13 @@ LLVMRustPrepareThinLTOInternalize(const LLVMRustThinLTOData *Data,
   return true;
 }
 
-extern "C" bool LLVMRustPrepareThinLTOImport(LLVMRustThinLTOData *Data,
+extern "C" bool LLVMRustPrepareThinLTOImport(const LLVMRustThinLTOData *Data,
                                              LLVMModuleRef M,
                                              LLVMTargetMachineRef TM) {
   Module &Mod = *unwrap(M);
   TargetMachine &Target = *unwrap(TM);
 
-  const auto &ImportList = Data->ImportLists[Mod.getModuleIdentifier()];
+  const auto &ImportList = Data->ImportLists.lookup(Mod.getModuleIdentifier());
   auto Loader = [&](StringRef Identifier) {
     const auto &Memory = Data->ModuleMap.lookup(Identifier);
     auto &Context = Mod.getContext();
@@ -1613,7 +1609,7 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
                                            LLVMRustThinLTOData *Data) {
   SmallString<40> Key;
   llvm::lto::Config conf;
-  const auto &ImportList = Data->ImportLists[ModId];
+  const auto &ImportList = Data->ImportLists.lookup(ModId);
   const auto &ExportList = Data->ExportLists.lookup(ModId);
   const auto &ResolvedODR = Data->ResolvedODR.lookup(ModId);
   const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(ModId);