1
Fork 0
We also have to remove the LLVM argument in cast-target-abi.rs for LLVM
21. I'm not really sure what the best approach here is since that test
already uses revisions. We could also fork the test into a copy for LLVM
19-20 and another for LLVM 21, but what I did for now was drop the
lint-abort-on-error flag to LLVM figuring that some coverage was better
than none, but I'm happy to change this if that was a bad direction.

The above also applies for ffi-out-of-bounds-loads.rs.

r? dianqk
@rustbot label llvm-main
This commit is contained in:
Augie Fackler 2025-03-31 14:34:14 -04:00
parent ab5b1be771
commit b14a0ce7f6
3 changed files with 11 additions and 6 deletions

View file

@ -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) {