[PATCH] D96987: [flang][fir][NFC] Move remaining types to TableGen type definition

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 13:45:16 PST 2021


rriddle added inline comments.


================
Comment at: flang/include/flang/Optimizer/Dialect/FIRTypes.td:200
+
+  let printer = [{
+    $_printer << "int<" << getFKind() << '>';
----------------
I'd prefer that the printers for these are defined with the parser. Can you move these to C++ as well?


================
Comment at: flang/include/flang/Optimizer/Dialect/FIRTypes.td:206
+    using KindTy = unsigned;
+
+  }];
----------------
Remove the extra newline here.




================
Comment at: flang/include/flang/Optimizer/Dialect/FIRTypes.td:219
+
+  let printer = [{
+    $_printer << "len";
----------------
You don't need to define a parser/printer for types with no parameters.


================
Comment at: flang/include/flang/Optimizer/Dialect/FIRTypes.td:259-261
+    $_printer << "ptr<";
+    $_printer.printType(getEleTy());
+    $_printer << '>';
----------------



================
Comment at: flang/include/flang/Optimizer/Dialect/FIRTypes.td:345
+    mlir::Type getElementType() const { return getEleTy(); }
+    static ReferenceType get(mlir::Type elementType);
+  }];
----------------
Use the builders field instead: https://mlir.llvm.org/docs/OpDefinitions/#custom-type-builder-methods


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96987



More information about the llvm-commits mailing list