[flang] Use the ShapedType::kDynamicSize constant instead of hardcoding it.
authorAlexander Belyaev <pifon@google.com>
Tue, 11 Oct 2022 14:26:42 +0000 (16:26 +0200)
committerAlexander Belyaev <pifon@google.com>
Tue, 11 Oct 2022 21:37:25 +0000 (23:37 +0200)
Differential Revision: https://reviews.llvm.org/D135675

flang/include/flang/Optimizer/Dialect/FIRTypes.td

index 8fc4f53..9d7c76e 100644 (file)
@@ -491,8 +491,10 @@ def fir_SequenceType : FIR_Type<"Sequence", "array"> {
     // Does the sequence have unknown shape? (`array<* x T>`)
     bool hasUnknownShape() const { return getShape().empty(); }
 
-    // The value `-1` represents an unknown extent for a dimension
-    static constexpr Extent getUnknownExtent() { return -1; }
+    // The value `kDynamicSize` represents an unknown extent for a dimension
+    static constexpr Extent getUnknownExtent() {
+      return mlir::ShapedType::kDynamicSize;
+    }
   }];
 }