Note: the type detection is different for the parser (has a push_back method) and printer (is an ArrayRef<T>).
Alternatively, one could override the parser/printer just for ArrayRefParameter. Please let me know if that's preferred.
Paths
| Differential D127737
[mlir] Surround array attributes with square brackets when parsing/printing. AbandonedPublic Authored by csigg on Jun 14 2022, 4:13 AM.
Details
Diff Detail
Event TimelineComment Actions I don't think this is something generically applicable. If you want a specific array parameter to be parsed with surrounding square brackets inside of struct(params), then I would recommend you just alter the parser and printer of that parameter instead of changing it for all array parameters: def SquareBracketArrayParameter : AttrParameter<...> { let parser = "parseSquareBracketArray(...)"; let printer = "printSquareBracketArray(...)"; } This revision now requires changes to proceed.Jun 14 2022, 9:57 AM
Revision Contents
Diff 436753 mlir/docs/AttributesAndTypes.md
mlir/include/mlir/IR/DialectImplementation.h
mlir/include/mlir/IR/OpImplementation.h
mlir/include/mlir/Support/StorageUniquer.h
mlir/test/lib/Dialect/Test/TestAttrDefs.td
mlir/test/lib/Dialect/Test/TestAttributes.cpp
mlir/test/lib/Dialect/Test/TestTypeDefs.td
|