Rollup merge of #69127 - tmiasko:new-pass-manager-use-after-scope, r=nikic

Enable use after scope detection in the new LLVM pass manager

Implementation of 08a1c566a7 for the new LLVM pass manager, support for which landed in the meantime.
This commit is contained in:
Dylan DPC 2020-02-13 21:28:11 +01:00 committed by GitHub
commit a8a2c141ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -761,14 +761,14 @@ LLVMRustOptimizeWithNewPassManager(
}
if (SanitizerOptions->SanitizeAddress) {
// FIXME: Rust does not expose the UseAfterScope option.
PipelineStartEPCallbacks.push_back([&](ModulePassManager &MPM) {
MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
});
OptimizerLastEPCallbacks.push_back(
[SanitizerOptions](FunctionPassManager &FPM, PassBuilder::OptimizationLevel Level) {
FPM.addPass(AddressSanitizerPass(
/*CompileKernel=*/false, SanitizerOptions->SanitizeRecover));
/*CompileKernel=*/false, SanitizerOptions->SanitizeRecover,
/*UseAfterScope=*/true));
}
);
PipelineStartEPCallbacks.push_back(