diff options
| author | DianQK <dianqk@dianqk.net> | 2024-08-29 18:12:31 +0800 |
|---|---|---|
| committer | DianQK <dianqk@dianqk.net> | 2024-08-29 18:12:31 +0800 |
| commit | 9589eb95d2872337e932c8b5dc26bdb5cb3dc15b (patch) | |
| tree | e711a79c37a3af29fc2f9479b788dfe57f6321a9 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | c9bd03cb724e13cca96ad320733046cbdb16fbbe (diff) | |
| download | rust-9589eb95d2872337e932c8b5dc26bdb5cb3dc15b.tar.gz rust-9589eb95d2872337e932c8b5dc26bdb5cb3dc15b.zip | |
Add `-Zlint-llvm-ir`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 283c4fbbb7c..39d97e175d6 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -713,7 +713,7 @@ extern "C" LLVMRustResult LLVMRustOptimize( LLVMModuleRef ModuleRef, LLVMTargetMachineRef TMRef, LLVMRustPassBuilderOptLevel OptLevelRust, LLVMRustOptStage OptStage, bool IsLinkerPluginLTO, bool NoPrepopulatePasses, bool VerifyIR, - bool UseThinLTOBuffers, bool MergeFunctions, bool UnrollLoops, + bool LintIR, bool UseThinLTOBuffers, bool MergeFunctions, bool UnrollLoops, bool SLPVectorize, bool LoopVectorize, bool DisableSimplifyLibCalls, bool EmitLifetimeMarkers, LLVMRustSanitizerOptions *SanitizerOptions, const char *PGOGenPath, const char *PGOUsePath, bool InstrumentCoverage, @@ -842,6 +842,13 @@ extern "C" LLVMRustResult LLVMRustOptimize( }); } + if (LintIR) { + PipelineStartEPCallbacks.push_back( + [](ModulePassManager &MPM, OptimizationLevel Level) { + MPM.addPass(createModuleToFunctionPassAdaptor(LintPass())); + }); + } + if (InstrumentGCOV) { PipelineStartEPCallbacks.push_back( [](ModulePassManager &MPM, OptimizationLevel Level) { |
