[PATCH] D74525: [mlir][DeclarativeParser] Add support for formatting enum attributes in the string form.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 11:38:04 PST 2020


rriddle marked 2 inline comments as done.
rriddle added inline comments.


================
Comment at: mlir/tools/mlir-tblgen/OpFormatGen.cpp:301
+    auto loc = parser.getCurrentLocation();
+    if (parser.parseAttribute(attrVal, parser.getBuilder().getNoneType(),
+                              "{0}", attrStorage))
----------------
antiagainst wrote:
> Do we want to specify none type here? It should parse as a string attr for start and we later reply on that for symbolize the string.
Without specifying a type, the parser of StringAttr will check for an optional colon type which isn't a desirable. Passing NoneType makes sure that we only parse the string value.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74525





More information about the llvm-commits mailing list