[PATCH] D77133: [mlir] Add an out-of-tree dialect example

Jean-Michel Gorius via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 31 18:12:48 PDT 2020


Kayjukh accepted this revision.
Kayjukh marked an inline comment as done.
Kayjukh added a comment.





================
Comment at: mlir/examples/standalone/lib/Standalone/StandaloneOps.cpp:22
+  // Parse the custom assembly format.
+  if (parser.parseOperand(operand) ||
+      parser.parseOptionalAttrDict(result.attributes) ||
----------------
rriddle wrote:
> Should you be using the declarative assembly format instead?
> 
> https://mlir.llvm.org/docs/OpDefinitions/#declarative-assembly-format
I considered using the declarative syntax at first, but I think using a custom parser and printer illustrates a more general (albeit rare) case where you might want to do more during parsing than what is done by the generated parser.

But as I said in a previous update comment, I am very much open to discussion on this point. I don't know if it is relevant to account for such corner cases in an example dialect.


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

https://reviews.llvm.org/D77133





More information about the llvm-commits mailing list