mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-29 00:21:14 +00:00
9a2fdc369d
Declarative attribute and type formats with assembly formats. Define an `assemblyFormat` field in attribute and type defs with a `mnemonic` to generate a parser and printer. ```tablegen def MyAttr : AttrDef<MyDialect, "MyAttr"> { let parameters = (ins "int64_t":$count, "AffineMap":$map); let mnemonic = "my_attr"; let assemblyFormat = "`<` $count `,` $map `>`"; } ``` Use `struct` to define a comma-separated list of key-value pairs: ```tablegen def MyType : TypeDef<MyDialect, "MyType"> { let parameters = (ins "int":$one, "int":$two, "int":$three); let mnemonic = "my_attr"; let assemblyFormat = "`<` $three `:` struct($one, $two) `>`"; } ``` Use `struct(*)` to capture all parameters. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D111594 |
||
---|---|---|
.. | ||
arcanist | ||
bazel |