[flang-commits] [flang] [Flang][MIF] Adding support of intrinsics with coarray argument (PR #192944)

via flang-commits flang-commits at lists.llvm.org
Thu Jun 18 00:58:07 PDT 2026


================
@@ -883,32 +902,41 @@ void fir::CharacterType::print(mlir::AsmPrinter &printer) const {
 // ClassType
 //===----------------------------------------------------------------------===//
 
-// `class` `<` type (`, volatile` $volatile^)? `>`
+// `class` `<` type (`, volatile` $volatile^)? (`, corank: corank` $corank^)?`>`
 mlir::Type fir::ClassType::parse(mlir::AsmParser &parser) {
   mlir::Type eleTy;
   auto location = parser.getCurrentLocation();
   auto *context = parser.getContext();
   bool isVolatile = false;
+  int64_t corank = 0;
   if (parser.parseLess() || parser.parseType(eleTy))
     return {};
-  if (parseOptionalCommaAndKeyword(parser, getVolatileKeyword(), isVolatile))
-    return {};
+  if (mlir::succeeded(parser.parseOptionalComma())) {
+    if (mlir::succeeded(parser.parseOptionalKeyword(getVolatileKeyword())))
+      isVolatile = true;
+    else if (mlir::succeeded(parser.parseKeyword(getCorankKeyword())))
+      if (mlir::succeeded(parser.parseOptionalColon()))
+        if (!mlir::succeeded(parser.parseInteger(corank)))
+          return {};
+  }
----------------
jeanPerier wrote:

Same here.

https://github.com/llvm/llvm-project/pull/192944


More information about the flang-commits mailing list