diff options
| author | Tyler Mandry <tmandry@google.com> | 2024-09-16 17:11:02 -0700 | 
|---|---|---|
| committer | Tyler Mandry <tmandry@google.com> | 2024-09-16 17:11:02 -0700 | 
| commit | 472fef6a70d6621611a20f13f02c16be93589f5c (patch) | |
| tree | d16ea6693aad23c764ef2b54fa41b8f458bb29db | |
| parent | d571ae851d93541bef826c3c48c1e9ad99da77d6 (diff) | |
| download | rust-472fef6a70d6621611a20f13f02c16be93589f5c.tar.gz rust-472fef6a70d6621611a20f13f02c16be93589f5c.zip | |
Revert "Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikic"
This reverts commit 8c7a7e346be4cdf13e77ab4acbfb5ade819a4e60, reversing changes made to a00bd75b6c5c96d0a35afa2dc07ce3155112d278.
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 10 | 
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 da27db29c87..c7306b0516f 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -1212,11 +1212,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 @@ -1425,13 +1421,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(); @@ -1614,7 +1610,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); | 
