aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorThurston Dang <thurston@google.com>2025-01-22 09:32:12 -0800
committerGitHub <noreply@github.com>2025-01-22 09:32:12 -0800
commit2476417232cdf2e1fce1a1df466b0995cdf559c5 (patch)
tree9565f9672ba8cb3f1944a10985848caa992fd585 /clang/lib/CodeGen/BackendUtil.cpp
parent44f316811016e677ca3e6c6237619e71bae28986 (diff)
downloadllvm-2476417232cdf2e1fce1a1df466b0995cdf559c5.zip
llvm-2476417232cdf2e1fce1a1df466b0995cdf559c5.tar.gz
llvm-2476417232cdf2e1fce1a1df466b0995cdf559c5.tar.bz2
Reapply "[sanitizer][NFCI] Add Options parameter to LowerAllowCheckPass" (#122833) (#122994)
This reverts commit 1515caf7a59dc20cb932b724b2ef5c1d1a593427 (https://github.com/llvm/llvm-project/pull/122833) i.e., relands 7d8b4eb0ead277f41ff69525ed807f9f6e227f37 (https://github.com/llvm/llvm-project/pull/122765), with LowerAllowCheckPass::Options moved inside the callback to fix a stack use-after-scope error. --------- Co-authored-by: Vitaly Buka <vitalybuka@gmail.com>
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 3951ad0..f60f867 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -796,10 +796,11 @@ static void addSanitizers(const Triple &TargetTriple,
if (LowerAllowCheckPass::IsRequested()) {
// We want to call it after inline, which is about OptimizerEarlyEPCallback.
- PB.registerOptimizerEarlyEPCallback([](ModulePassManager &MPM,
- OptimizationLevel Level,
- ThinOrFullLTOPhase Phase) {
- MPM.addPass(createModuleToFunctionPassAdaptor(LowerAllowCheckPass()));
+ PB.registerOptimizerEarlyEPCallback([&](ModulePassManager &MPM,
+ OptimizationLevel Level,
+ ThinOrFullLTOPhase Phase) {
+ LowerAllowCheckPass::Options Opts;
+ MPM.addPass(createModuleToFunctionPassAdaptor(LowerAllowCheckPass(Opts)));
});
}
}