[Mlir-commits] [mlir] [mlir][Quasipolynomial] Fixed -Wunused-variable in GeneratorFunction.h (PR #76419)

Balaji V. Iyer. llvmlistbot at llvm.org
Tue Dec 26 16:29:43 PST 2023


https://github.com/bviyer created https://github.com/llvm/llvm-project/pull/76419

```
llvm-project/mlir/lib/Analysis/Presburger/GeneratingFunction.h:56:28:
error: unused variable 'term' [-Werror,-Wunused-variable]
   56 |     for (const ParamPoint &term : numerators)
      |                            ^~~~
1 error generated.
```

>From e4c77597e9f2264426efb5368068ebe984825ea5 Mon Sep 17 00:00:00 2001
From: "Balaji V. Iyer" <bviyer at gmail.com>
Date: Tue, 26 Dec 2023 18:23:59 -0600
Subject: [PATCH] [mlir][Quasipolynomial] Fixed -Wunused-variable in
 GeneratorFunction.h ```
 llvm-project/mlir/lib/Analysis/Presburger/GeneratingFunction.h:56:28: error:
 unused variable 'term' [-Werror,-Wunused-variable]    56 |     for (const
 ParamPoint &term : numerators)       |                            ^~~~ 1
 error generated. ```

---
 mlir/lib/Analysis/Presburger/GeneratingFunction.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mlir/lib/Analysis/Presburger/GeneratingFunction.h b/mlir/lib/Analysis/Presburger/GeneratingFunction.h
index dad9594f960d1b..f7deba921ea51e 100644
--- a/mlir/lib/Analysis/Presburger/GeneratingFunction.h
+++ b/mlir/lib/Analysis/Presburger/GeneratingFunction.h
@@ -53,10 +53,12 @@ class GeneratingFunction {
                      std::vector<ParamPoint> nums,
                      std::vector<std::vector<Point>> dens)
       : numParam(numParam), signs(signs), numerators(nums), denominators(dens) {
+#ifndef NDEBUG
     for (const ParamPoint &term : numerators)
       assert(term.getNumColumns() == numParam + 1 &&
              "dimensionality of numerator exponents does not match number of "
              "parameters!");
+#endif // NDEBUG
   }
 
   unsigned getNumParams() { return numParam; }



More information about the Mlir-commits mailing list