[llvm] llvm-reduce: Add scope braces (PR #135025)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 9 07:22:41 PDT 2025
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/135025
>From 525322bcb3e01f4fd6f63d6542e41f9f74ea23e1 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Sat, 14 Jan 2023 15:17:22 -0500
Subject: [PATCH] llvm-reduce: Add scope braces
Make sure these temporary variables don't leak out
of the NDEBUG block.
---
llvm/tools/llvm-reduce/deltas/Delta.cpp | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/llvm/tools/llvm-reduce/deltas/Delta.cpp b/llvm/tools/llvm-reduce/deltas/Delta.cpp
index d4106b0243aea..6bf1b99346b13 100644
--- a/llvm/tools/llvm-reduce/deltas/Delta.cpp
+++ b/llvm/tools/llvm-reduce/deltas/Delta.cpp
@@ -214,14 +214,16 @@ void llvm::runDeltaPass(TestRunner &Test, const DeltaPass &Pass) {
}
#ifndef NDEBUG
- // Make sure that the number of chunks does not change as we reduce.
- std::vector<Chunk> NoChunks = {{0, INT_MAX}};
- Oracle NoChunksCounter(NoChunks);
- std::unique_ptr<ReducerWorkItem> Clone =
- Test.getProgram().clone(Test.getTargetMachine());
- Pass.Func(NoChunksCounter, *Clone);
- assert(Targets == NoChunksCounter.count() &&
- "number of chunks changes when reducing");
+ {
+ // Make sure that the number of chunks does not change as we reduce.
+ std::vector<Chunk> NoChunks = {{0, INT_MAX}};
+ Oracle NoChunksCounter(NoChunks);
+ std::unique_ptr<ReducerWorkItem> Clone =
+ Test.getProgram().clone(Test.getTargetMachine());
+ Pass.Func(NoChunksCounter, *Clone);
+ assert(Targets == NoChunksCounter.count() &&
+ "number of chunks changes when reducing");
+ }
#endif
}
if (!Targets) {
More information about the llvm-commits
mailing list