Fix use of variables only used in asserts.

This otherwise triggers "unused variable" errors in optimized build mode.

--

PiperOrigin-RevId: 248706350
This commit is contained in:
MLIR Team 2019-05-17 06:04:14 -07:00 committed by Mehdi Amini
parent 69ef8642df
commit 7e11eb1f87
1 changed files with 6 additions and 2 deletions

View File

@ -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;