Skip to content

Commit

Permalink
Enable use after scope detection in the new LLVM pass manager
Browse files Browse the repository at this point in the history
Implementation of 08a1c56 for the new
LLVM pass manager, support for which landed in the meantime.
  • Loading branch information
tmiasko committed Feb 13, 2020
1 parent 2e6eace commit 91b4a24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rustllvm/PassWrapper.cpp
Expand Up @@ -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(
Expand Down

0 comments on commit 91b4a24

Please sign in to comment.