summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2019-02-14 05:18:18 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 16:27:25 -0700
commitf2c93f09956ce30e9670ca18d27dc13b76306552 (patch)
treecb5fecbaeca95005b361c20bfc88c852922869df
parent50700b81220ae54710ea9dac556b84554b4f1935 (diff)
downloadbcm5719-llvm-f2c93f09956ce30e9670ca18d27dc13b76306552.tar.gz
bcm5719-llvm-f2c93f09956ce30e9670ca18d27dc13b76306552.zip
EDSC: fix unused-wariable warning when compiling without assertions
In LowerEDSCTestPass, there are two range-for loops that only do assertions on the loop variable. With assertions disabled, the variable becomes unused and triggers a warning promoted to error. Cast it to void in the loop to supress the warning. PiperOrigin-RevId: 233936171
-rw-r--r--mlir/lib/EDSC/LowerEDSCTestPass.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/mlir/lib/EDSC/LowerEDSCTestPass.cpp b/mlir/lib/EDSC/LowerEDSCTestPass.cpp
index 5ce7d51e380..f66cf455885 100644
--- a/mlir/lib/EDSC/LowerEDSCTestPass.cpp
+++ b/mlir/lib/EDSC/LowerEDSCTestPass.cpp
@@ -51,9 +51,11 @@ PassResult LowerEDSCTestPass::runOnFunction(Function *f) {
FuncBuilder builder(&f->getBlocks().front(),
f->getBlocks().front().begin());
assert(f->getNumArguments() == 2 && "dynamic_for expected 4 arguments");
- for (const auto *arg : f->getArguments())
+ for (const auto *arg : f->getArguments()) {
+ (void)arg;
assert(arg->getType().isIndex() &&
"dynamic_for expected index arguments");
+ }
edsc::ScopedEDSCContext context;
edsc::Expr lb, ub, step;
@@ -73,9 +75,11 @@ PassResult LowerEDSCTestPass::runOnFunction(Function *f) {
FuncBuilder builder(&f->getBlocks().front(),
f->getBlocks().front().begin());
assert(f->getNumArguments() == 4 && "dynamic_for expected 4 arguments");
- for (const auto *arg : f->getArguments())
+ for (const auto *arg : f->getArguments()) {
+ (void)arg;
assert(arg->getType().isIndex() &&
"dynamic_for expected index arguments");
+ }
edsc::ScopedEDSCContext context;
edsc::Expr lb1, lb2, ub1, ub2, step;
OpenPOWER on IntegriCloud