[flang-commits] [flang] 51db96a - [flang] Use the ShapedType::kDynamicSize constant instead of hardcoding it.

Alexander Belyaev via flang-commits flang-commits at lists.llvm.org
Tue Oct 11 14:37:58 PDT 2022


Author: Alexander Belyaev
Date: 2022-10-11T23:37:25+02:00
New Revision: 51db96ad2b39ee365200f3421b75e977395d8b85

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

LOG: [flang] Use the ShapedType::kDynamicSize constant instead of hardcoding it.

Differential Revision: https://reviews.llvm.org/D135675

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Optimizer/Dialect/FIRTypes.td b/flang/include/flang/Optimizer/Dialect/FIRTypes.td
index 8fc4f53cd2eac..9d7c76ec6b9a8 100644
--- a/flang/include/flang/Optimizer/Dialect/FIRTypes.td
+++ b/flang/include/flang/Optimizer/Dialect/FIRTypes.td
@@ -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;
+    }
   }];
 }
 


        


More information about the flang-commits mailing list