diff options
| author | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2023-11-15 19:58:52 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2023-11-21 22:40:16 +0100 |
| commit | 7de6d04bc8033644c09fd1273b6fb3164d04fab3 (patch) | |
| tree | 60e41716747a9033ac93633664c15e384d2ff08c /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | 2f8d81f9dbac6b8df982199f69da04a4c8357227 (diff) | |
| download | rust-7de6d04bc8033644c09fd1273b6fb3164d04fab3.tar.gz rust-7de6d04bc8033644c09fd1273b6fb3164d04fab3.zip | |
Update the minimum external LLVM to 16.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 31565db1b79..25af07ff3d3 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -204,11 +204,7 @@ enum class LLVMRustCodeModel { None, }; -#if LLVM_VERSION_LT(16, 0) -static Optional<CodeModel::Model> -#else static std::optional<CodeModel::Model> -#endif fromRust(LLVMRustCodeModel Model) { switch (Model) { case LLVMRustCodeModel::Tiny: @@ -222,11 +218,7 @@ fromRust(LLVMRustCodeModel Model) { case LLVMRustCodeModel::Large: return CodeModel::Large; case LLVMRustCodeModel::None: -#if LLVM_VERSION_LT(16, 0) - return None; -#else return std::nullopt; -#endif default: report_fatal_error("Bad CodeModel."); } @@ -452,7 +444,6 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( if (OutputObjFile) { Options.ObjectFilenameForDebug = OutputObjFile; } -#if LLVM_VERSION_GE(16, 0) if (!strcmp("zlib", DebugInfoCompression) && llvm::compression::zlib::isAvailable()) { Options.CompressDebugSections = DebugCompressionType::Zlib; } else if (!strcmp("zstd", DebugInfoCompression) && llvm::compression::zstd::isAvailable()) { @@ -460,7 +451,6 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( } else if (!strcmp("none", DebugInfoCompression)) { Options.CompressDebugSections = DebugCompressionType::None; } -#endif Options.RelaxELFRelocations = RelaxELFRelocations; Options.UseInitArray = UseInitArray; @@ -734,22 +724,14 @@ LLVMRustOptimize( bool DebugPassManager = false; PassInstrumentationCallbacks PIC; -#if LLVM_VERSION_LT(16, 0) - StandardInstrumentations SI(DebugPassManager); -#else StandardInstrumentations SI(TheModule->getContext(), DebugPassManager); -#endif SI.registerCallbacks(PIC); if (LlvmSelfProfiler){ LLVMSelfProfileInitializeCallbacks(PIC,LlvmSelfProfiler,BeforePassCallback,AfterPassCallback); } -#if LLVM_VERSION_LT(16, 0) - Optional<PGOOptions> PGOOpt; -#else std::optional<PGOOptions> PGOOpt; -#endif #if LLVM_VERSION_GE(17, 0) auto FS = vfs::getRealFileSystem(); #endif @@ -882,12 +864,7 @@ LLVMRustOptimize( /*EagerChecks=*/true); OptimizerLastEPCallbacks.push_back( [Options](ModulePassManager &MPM, OptimizationLevel Level) { -#if LLVM_VERSION_LT(16, 0) - MPM.addPass(ModuleMemorySanitizerPass(Options)); - MPM.addPass(createModuleToFunctionPassAdaptor(MemorySanitizerPass(Options))); -#else MPM.addPass(MemorySanitizerPass(Options)); -#endif } ); } @@ -912,11 +889,7 @@ LLVMRustOptimize( /*UseAfterScope=*/true, AsanDetectStackUseAfterReturnMode::Runtime, }; -#if LLVM_VERSION_LT(16, 0) - MPM.addPass(ModuleAddressSanitizerPass(opts)); -#else MPM.addPass(AddressSanitizerPass(opts)); -#endif } ); } |
