llvm-project/mlir/tools/mlir-reduce
Alex Zinenko 2996a8d675 [mlir] avoid exposing mutable DialectRegistry from MLIRContext
MLIRContext allows its users to access directly to the DialectRegistry it
contains. While sometimes useful for registering additional dialects on an
already existing context, this breaks the encapsulation by essentially giving
raw accesses to a part of the context's internal state. Remove this mutable
access and instead provide a method to append a given DialectRegistry to the
one already contained in the context. Also provide a shortcut mechanism to
construct a context from an already existing registry, which seems to be a
common use case in the wild. Keep read-only access to the registry contained in
the context in case it needs to be copied or used for constructing another
context.

With this change, DialectRegistry is no longer concerned with loading the
dialects and deciding whether to invoke delayed interface registration. Loading
is concentrated in the MLIRContext, and the functionality of the registry
better reflects its name.

Depends On D96137

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D96331
2021-02-10 12:07:34 +01:00
..
Passes [mlir] NFC: fix trivial typos 2020-10-29 04:05:22 +09:00
CMakeLists.txt Revert "[RFC] Factor out repetitive cmake patterns for llvm-style projects" 2020-10-04 15:17:34 -07:00
OptReductionPass.cpp Fix gcc warning by explicitly initializing the base class copy ctor (NFC) 2020-08-30 17:46:51 +00:00
ReductionNode.cpp [mlir] NFC: fix trivial typos 2020-10-29 04:05:22 +09:00
ReductionTreeUtils.cpp [mlir] NFC: fix trivial typos 2020-10-29 04:05:22 +09:00
mlir-reduce.cpp [mlir] avoid exposing mutable DialectRegistry from MLIRContext 2021-02-10 12:07:34 +01:00