llvm-project/mlir/unittests/IR
Mehdi Amini 575b22b5d1 Revisit Dialect registration: require and store a TypeID on dialects
This patch moves the registration to a method in the MLIRContext: getOrCreateDialect<ConcreteDialect>()

This method requires dialect to provide a static getDialectNamespace()
and store a TypeID on the Dialect itself, which allows to lazyily
create a dialect when not yet loaded in the context.
As a side effect, it means that duplicated registration of the same
dialect is not an issue anymore.

To limit the boilerplate, TableGen dialect generation is modified to
emit the constructor entirely and invoke separately a "init()" method
that the user implements.

Differential Revision: https://reviews.llvm.org/D85495
2020-08-07 15:57:08 +00:00
..
AttributeTest.cpp [mlir] Fix representation of BF16 constants 2020-06-05 17:43:06 -07:00
CMakeLists.txt [llvm][StringExtras] Merge StringExtras from MLIR into LLVM 2020-04-14 18:57:22 -07:00
DialectTest.cpp Revisit Dialect registration: require and store a TypeID on dialects 2020-08-07 15:57:08 +00:00
OperationSupportTest.cpp [mlir] Add a new MutableOperandRange class for adding/remove operands 2020-04-29 16:48:14 -07:00