Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,15 @@ extern "C" LLVMRustResult LLVMRustOptimize(
}

if (LintIR) {
PipelineStartEPCallbacks.push_back(
[](ModulePassManager &MPM, OptimizationLevel Level) {
MPM.addPass(createModuleToFunctionPassAdaptor(LintPass()));
});
PipelineStartEPCallbacks.push_back([](ModulePassManager &MPM,
OptimizationLevel Level) {
#if LLVM_VERSION_GE(21, 0)
MPM.addPass(
createModuleToFunctionPassAdaptor(LintPass(/*AbortOnError=*/true)));
#else
MPM.addPass(createModuleToFunctionPassAdaptor(LintPass()));
#endif
});
}

if (InstrumentCoverage) {
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/cast-target-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ add-core-stubs
//@ revisions:aarch64 loongarch64 powerpc64 sparc64 x86_64
//@ min-llvm-version: 19
//@ compile-flags: -Copt-level=3 -Cno-prepopulate-passes -Zlint-llvm-ir -Cllvm-args=-lint-abort-on-error
//@ compile-flags: -Copt-level=3 -Cno-prepopulate-passes -Zlint-llvm-ir

//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
//@[aarch64] needs-llvm-components: arm
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/cffi/ffi-out-of-bounds-loads.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ add-core-stubs
//@ revisions: linux apple
//@ min-llvm-version: 19
//@ compile-flags: -Copt-level=0 -Cno-prepopulate-passes -Zlint-llvm-ir -Cllvm-args=-lint-abort-on-error
//@ compile-flags: -Copt-level=0 -Cno-prepopulate-passes -Zlint-llvm-ir

//@[linux] compile-flags: --target x86_64-unknown-linux-gnu
//@[linux] needs-llvm-components: x86
Expand Down
Loading