Respect -Z verify-llvm-ir and other flags that add extra passes when combined with -C no-prepopulate-passes in the new LLVM Pass Manager.

This commit is contained in:
Luqman Aden 2022-04-10 15:30:35 -04:00
parent 18f32b73bd
commit 84fb481bf5

View file

@ -995,6 +995,13 @@ LLVMRustOptimizeWithNewPassManager(
break;
}
}
} else {
// We're not building any of the default pipelines but we still want to
// add the verifier, instrumentation, etc passes if they were requested
for (const auto &C : PipelineStartEPCallbacks)
C(MPM, OptLevel);
for (const auto &C : OptimizerLastEPCallbacks)
C(MPM, OptLevel);
}
if (ExtraPassesLen) {