llvm-project/mlir/lib/TableGen
River Riddle 23e3cbe24a [mlir] Refactor how parser/printers are specified for AttrDef/TypeDef
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
2022-03-15 00:42:31 -07:00
..
Argument.cpp [mlir] Add support for VariadicOfVariadic operands 2021-08-23 20:32:31 +00:00
AttrOrTypeDef.cpp [mlir] Refactor how parser/printers are specified for AttrDef/TypeDef 2022-03-15 00:42:31 -07:00
Attribute.cpp Fix more clang-tidy cleanups in mlir/ (NFC) 2021-12-22 20:53:11 +00:00
Builder.cpp [mlir][NFC] Add a using for llvm::SMLoc/llvm::SMRange to LLVM.h 2022-01-26 21:37:23 -08:00
CMakeLists.txt [mlir][ods] Cleanup of Class Codegen helper 2021-11-12 21:22:01 +00:00
Class.cpp [mlir][ods] ODS ops get an `extraClassDefinition` 2022-01-06 01:43:26 +00:00
Constraint.cpp [PDLL] Add support for tablegen includes and importing ODS information 2022-03-03 16:14:03 -08:00
Dialect.cpp Revert "[mlir] Add extensible dialects" 2022-03-03 10:30:50 +00:00
Format.cpp [llvm] Cleanup header dependencies in ADT and Support 2022-01-21 13:54:49 +01:00
Interfaces.cpp [mlir] Support verification order (2/3) 2022-02-25 19:04:56 +00:00
Operator.cpp [mlir][ODS] Infer return types if the operands are variadic but the results are not 2022-02-18 15:29:06 +01:00
Pass.cpp Fix more clang-tidy cleanups in mlir/ (NFC) 2021-12-22 20:53:11 +00:00
Pattern.cpp [mlir][Rewrite] Add support for using an operation with no results as location 2022-02-03 15:08:09 +01:00
Predicate.cpp [mlir][NFC] Add a using for llvm::SMLoc/llvm::SMRange to LLVM.h 2022-01-26 21:37:23 -08:00
Region.cpp [mlir][ODS] Add support for variadic regions. 2020-04-05 01:03:38 -07:00
SideEffects.cpp [mlir] Add support for adding attribute+type traits/interfaces to tablegen defs 2021-04-15 11:41:51 -07:00
Successor.cpp [llvm][ADT] Move TypeSwitch class from MLIR to LLVM 2020-04-14 15:14:41 -07:00
Trait.cpp [mlir] Support verification order (2/3) 2022-02-25 19:04:56 +00:00
Type.cpp [mlir][ods] Unique attribute, successor, region constraints 2021-11-12 01:04:08 +00:00