aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2021-02-10 10:11:50 +0100
committerAlex Zinenko <zinenko@google.com>2021-02-10 12:07:34 +0100
commit2996a8d67553b9d469e01215b49bb1af17ad6d1e (patch)
tree7a72125c31dd6b0e52b22a2ee0b2c0f5f8adf72f /clang/lib/Frontend/CompilerInvocation.cpp
parent3da51522fb4f72b7d4619f2dfd454bb3073ab460 (diff)
downloadllvm-2996a8d67553b9d469e01215b49bb1af17ad6d1e.zip
llvm-2996a8d67553b9d469e01215b49bb1af17ad6d1e.tar.gz
llvm-2996a8d67553b9d469e01215b49bb1af17ad6d1e.tar.bz2
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions