forked from OSchip/llvm-project
23e3cbe24a
There is currently an awkwardly complex set of rules for how a parser/printer is generated for AttrDef/TypeDef. It can change depending on if a mnemonic was specified, if there are parameters, if using the assemblyFormat, if individual parser/printer code blocks were specified, etc. This commit refactors this to make what the attribute/type wants more explicit, and to better align with how formats are specified for operations. Firstly, the parser/printer code blocks are removed in favor of a `hasCustomAssemblyFormat` bit field. This aligns with the operation format specification (and is nice to remove code blocks from ODS). This commit also adds a requirement to explicitly set `assemblyFormat` or `hasCustomAssemblyFormat` when the mnemonic is set and the attr/type has no parameters. This removes the weird implicit matrix of behavior, and also encourages the author to make a conscious choice of either C++ or declarative format instead of implicitly opting them into the C++ format (we should be pushing towards declarative when possible). Differential Revision: https://reviews.llvm.org/D121505 |
||
---|---|---|
.. | ||
Argument.cpp | ||
AttrOrTypeDef.cpp | ||
Attribute.cpp | ||
Builder.cpp | ||
CMakeLists.txt | ||
Class.cpp | ||
Constraint.cpp | ||
Dialect.cpp | ||
Format.cpp | ||
Interfaces.cpp | ||
Operator.cpp | ||
Pass.cpp | ||
Pattern.cpp | ||
Predicate.cpp | ||
Region.cpp | ||
SideEffects.cpp | ||
Successor.cpp | ||
Trait.cpp | ||
Type.cpp |