[Mlir-commits] [mlir] ffde3ac - [ShapeDialect] Silence a build warning, NFC

Chris Lattner llvmlistbot at llvm.org
Sun Mar 21 10:11:23 PDT 2021


Author: Chris Lattner
Date: 2021-03-21T10:10:38-07:00
New Revision: ffde3acb1b9c0f88f99bda82fd080de2d44ef50b

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

LOG: [ShapeDialect] Silence a build warning, NFC

mlir/lib/Dialect/Shape/IR/Shape.cpp:573:26: warning: loop variable 'shape' is always a copy because the range of type '::mlir::Operation::operand_range' (aka 'mlir::OperandRange') does not return a reference [-Wrange-loop-analysis]
        for (const auto &shape : shapes()) {
                         ^

Added: 
    

Modified: 
    mlir/lib/Dialect/Shape/IR/Shape.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Shape/IR/Shape.cpp b/mlir/lib/Dialect/Shape/IR/Shape.cpp
index 33719951f3e9..f3a66a7bc67a 100644
--- a/mlir/lib/Dialect/Shape/IR/Shape.cpp
+++ b/mlir/lib/Dialect/Shape/IR/Shape.cpp
@@ -570,9 +570,9 @@ OpFoldResult CstrBroadcastableOp::fold(ArrayRef<Attribute> operands) {
   // on the input shapes.
   if ([&] {
         SmallVector<SmallVector<int64_t, 6>, 6> extents;
-        for (const auto &shape : shapes()) {
+        for (auto shapeValue : shapes()) {
           extents.emplace_back();
-          if (failed(getShapeVec(shape, extents.back())))
+          if (failed(getShapeVec(shapeValue, extents.back())))
             return false;
         }
         return OpTrait::util::staticallyKnownBroadcastable(extents);


        


More information about the Mlir-commits mailing list