[PATCH] D110415: [fir] Update fir.alloca op

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 24 09:36:26 PDT 2021


mehdi_amini added inline comments.


================
Comment at: flang/include/flang/Optimizer/Dialect/FIROps.td:288
 
-  let verifier = allocVerify#[{
-    mlir::Type outType = getType();
-    if (!outType.isa<fir::ReferenceType>())
-      return emitOpError("must be a !fir.ref type");
-    if (fir::isa_unknown_size_box(fir::dyn_cast_ptrEleTy(outType)))
-      return emitOpError("cannot allocate !fir.box of unknown rank or type");
-    return mlir::success();
-  }];
+  let parser = "return parseAlloca(parser, result);";
+  let printer = "printAlloca(p, *this);";
----------------
Why not save an indirection and write directly here: `return parseAllocatableOp(wrapAllocaResultType, parser, result);`?



================
Comment at: flang/include/flang/Optimizer/Dialect/FIROps.td:289
+  let parser = "return parseAlloca(parser, result);";
+  let printer = "printAlloca(p, *this);";
+
----------------
(same here: `  printAllocatableOp(p, this);`)


================
Comment at: flang/lib/Optimizer/Dialect/FIROps.cpp:171
+                          mlir::OperationState &result, mlir::Type in_type,
+                          llvm::StringRef uniq_name,
+                          mlir::ValueRange typeparams, mlir::ValueRange shape,
----------------
Is clang-tidy right here or is the clang-tidy configuration incorrect?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110415/new/

https://reviews.llvm.org/D110415



More information about the llvm-commits mailing list