llvm-project/mlir/unittests/TableGen
Vladislav Vinogradov fee9054232 [mlir][ODS] Support specialized Attribute class for Enums
Add a feature to `EnumAttr` definition to generate
specialized Attribute class for the particular enumeration.

This class will inherit `StringAttr` or `IntegerAttr` and
will override `classof` and `getValue` methods.

With this class the enumeration predicate can be checked with simple
RTTI calls (`isa`, `dyn_cast`) and it will return the typed enumeration
directly instead of raw string/integer.

Based on the following discussion:
https://llvm.discourse.group/t/rfc-add-enum-attribute-decorator-class/2252

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D97836
2021-03-17 16:44:24 +03:00
..
CMakeLists.txt [MLIR] Add unit test for tblgen Op build methods 2020-07-28 15:43:37 -07:00
EnumsGenTest.cpp [mlir][ODS] Support specialized Attribute class for Enums 2021-03-17 16:44:24 +03:00
FormatTest.cpp [NFC] Fix comment style in MLIR unittests to conform to LLVM coding standards. 2020-07-12 07:27:02 -07:00
OpBuildGen.cpp [mlir][Types][NFC] Move all of the builtin Type classes to BuiltinTypes.h 2020-12-03 18:02:10 -08:00
StructsGenTest.cpp Revert "Revert "Reorder MLIRContext location in BuiltinAttributes.h"" 2021-02-08 10:39:58 +01:00
enums.td [mlir][ODS] Support specialized Attribute class for Enums 2021-03-17 16:44:24 +03:00
structs.td [mlir][ODS] Rename several uses of 'description' to 'summary' 2021-01-06 14:18:58 -08:00