llvm-project/mlir/tools/mlir-tblgen
Alex Zinenko a4f81b2054 [mlir] ODS: emit interface traits outside of the interface class
ODS currently emits the interface trait class as a nested class inside the
interface class. As an unintended consequence, the default implementations of
interface methods have implicit access to static fields of the interface class,
e.g. those declared in `extraClassDeclaration`, including private methods (!),
or in the parent class. This may break the use of default implementations for
external models, which are not defined in the interface class, and generally
complexifies the abstraction.

Emit intraface traits outside of the interface class itself to avoid accidental
implicit visibility. Public static fields can still be accessed via explicit
qualification with a class name, e.g., `MyOpInterface::staticMethod()` instead
of `staticMethod`.

Update the documentation to clarify the role of `extraClassDeclaration` in
interfaces.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D104384
2021-06-17 10:25:35 +02:00
..
AttrOrTypeDefGen.cpp [mlir] Add support for adding attribute+type traits/interfaces to tablegen defs 2021-04-15 11:41:51 -07:00
CMakeLists.txt [mlir] Hoist out getRequestedOpDefinitions helper 2021-04-06 12:53:28 -07:00
DialectGen.cpp [mlir] Support dialect-wide canonicalization pattern registration 2021-05-27 17:35:21 +09:00
DirectiveCommonGen.cpp [mlir][openacc] Use TableGen information for default enum 2021-01-12 09:42:42 -05:00
DocGenUtilities.h Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
EnumsGen.cpp [mlir][ODS] Support specialized Attribute class for Enums 2021-03-17 16:44:24 +03:00
LLVMIRConversionGen.cpp [mlir] generate enum translation functions with unused attribute 2021-02-18 09:44:40 +01:00
LLVMIRIntrinsicGen.cpp [mlir] Add an AccessGroup attribute to load/store LLVM dialect ops and generate the access_group LLVM metadata. 2021-03-04 18:17:23 +01:00
OpDefinitionsGen.cpp [mlir:OpFormatGen] Add Support for `$_ctxt` in the transformer. 2021-06-14 18:02:55 -07:00
OpDocGen.cpp Change add_mlir_doc CMake macro to take the tablegen command as last argument to allow extra flags 2021-04-15 02:59:40 +00:00
OpFormatGen.cpp [mlir:OpFormatGen] Add Support for `$_ctxt` in the transformer. 2021-06-14 18:02:55 -07:00
OpFormatGen.h [mlir] Add initial support for parsing a declarative operation assembly format 2020-01-30 11:43:40 -08:00
OpGenHelpers.cpp [mlir] Hoist out getRequestedOpDefinitions helper 2021-04-06 12:53:28 -07:00
OpGenHelpers.h [mlir] Hoist out getRequestedOpDefinitions helper 2021-04-06 12:53:28 -07:00
OpInterfacesGen.cpp [mlir] ODS: emit interface traits outside of the interface class 2021-06-17 10:25:35 +02:00
OpPythonBindingGen.cpp [mlir][python] Reorganize MLIR python into namespace packages. 2021-03-08 23:01:34 -08:00
PassCAPIGen.cpp Add basic Python bindings for the PassManager and bind libTransforms 2020-11-10 19:55:21 +00:00
PassDocGen.cpp [mlir][Pass] Update the PassGen to generate base classes instead of utilities 2020-04-07 14:08:52 -07:00
PassGen.cpp Decouple registring passes from specifying argument/description 2021-06-16 23:41:50 +00:00
RewriterGen.cpp Support NativeCodeCall binding in rewrite pattern. 2021-05-10 09:29:27 +08:00
SPIRVUtilsGen.cpp [mlir] separable registration of attribute and type interfaces 2021-06-15 15:20:27 +02:00
StructsGen.cpp Revert "Revert "Reorder MLIRContext location in BuiltinAttributes.h"" 2021-02-08 10:39:58 +01:00
mlir-tblgen.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00