[Mlir-commits] [mlir] 803cec0 - [mlir] Fix a warning

Kazu Hirata llvmlistbot at llvm.org
Fri Nov 26 12:27:23 PST 2021


Author: Kazu Hirata
Date: 2021-11-26T12:27:11-08:00
New Revision: 803cec0268000569051733e0d03b4c51d48ce5a6

URL: https://github.com/llvm/llvm-project/commit/803cec0268000569051733e0d03b4c51d48ce5a6
DIFF: https://github.com/llvm/llvm-project/commit/803cec0268000569051733e0d03b4c51d48ce5a6.diff

LOG: [mlir] Fix a warning

This patch fixes:

  mlir/lib/IR/MLIRContext.cpp:1020:3: error: use of the 'nodiscard'
  attribute is a C++17 extension [-Werror,-Wc++17-extensions]

Added: 
    

Modified: 
    mlir/lib/IR/MLIRContext.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/IR/MLIRContext.cpp b/mlir/lib/IR/MLIRContext.cpp
index 1eba3b0b5b29..6f54703e9b62 100644
--- a/mlir/lib/IR/MLIRContext.cpp
+++ b/mlir/lib/IR/MLIRContext.cpp
@@ -1017,9 +1017,9 @@ AffineMap AffineMap::getImpl(unsigned dimCount, unsigned symbolCount,
 /// present in result expressions is less than `dimCount` and the highest index
 /// of symbolic identifier present in result expressions is less than
 /// `symbolCount`.
-[[nodiscard]] static bool willBeValidAffineMap(unsigned dimCount,
-                                               unsigned symbolCount,
-                                               ArrayRef<AffineExpr> results) {
+LLVM_NODISCARD static bool willBeValidAffineMap(unsigned dimCount,
+                                                unsigned symbolCount,
+                                                ArrayRef<AffineExpr> results) {
   int64_t maxDimPosition = -1;
   int64_t maxSymbolPosition = -1;
   getMaxDimAndSymbol(ArrayRef<ArrayRef<AffineExpr>>(results), maxDimPosition,


        


More information about the Mlir-commits mailing list