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.
Can we have it just mean a comma list of parameter values when used outside of struct?