From 7e11eb1f8710f75739a9e052897340de5a3de34b Mon Sep 17 00:00:00 2001 From: MLIR Team Date: Fri, 17 May 2019 06:04:14 -0700 Subject: [PATCH] Fix use of variables only used in asserts. This otherwise triggers "unused variable" errors in optimized build mode. -- PiperOrigin-RevId: 248706350 --- mlir/lib/IR/SDBM.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mlir/lib/IR/SDBM.cpp b/mlir/lib/IR/SDBM.cpp index 438857de18cb..30233494b97d 100644 --- a/mlir/lib/IR/SDBM.cpp +++ b/mlir/lib/IR/SDBM.cpp @@ -171,10 +171,14 @@ public: SDBMBuilderResult visitSum(SDBMSumExpr expr) { auto lhs = visit(expr.getLHS()); auto rhs = visit(expr.getRHS()); - for (auto pos : rhs.negativePos) + for (auto pos : rhs.negativePos) { + (void)pos; assert(pos == 0 && "unexpected variable on the RHS of SDBM sum"); - for (auto pos : rhs.positivePos) + } + for (auto pos : rhs.positivePos) { + (void)pos; assert(pos == 0 && "unexpected variable on the RHS of SDBM sum"); + } lhs.value += rhs.value; return lhs;