Skip to content

Commit 69b9e03

Browse files
[mlir] Do not expose MLIRContext::isDialectLoading
This addresses post-commit comments and should have been part of D136685. Differential Revision: https://reviews.llvm.org/D136923
1 parent e12b627 commit 69b9e03

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

mlir/include/mlir/IR/MLIRContext.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ class MLIRContext {
9898
}));
9999
}
100100

101-
/// Return true if the given dialect is currently loading.
102-
bool isDialectLoading(StringRef dialectNamespace);
103-
104101
/// Load a dialect in the context.
105102
template <typename Dialect>
106103
void loadDialect() {
@@ -239,6 +236,9 @@ class MLIRContext {
239236
llvm::hash_code getRegistryHash();
240237

241238
private:
239+
/// Return true if the given dialect is currently loading.
240+
bool isDialectLoading(StringRef dialectNamespace);
241+
242242
const std::unique_ptr<MLIRContextImpl> impl;
243243

244244
MLIRContext(const MLIRContext &) = delete;

mlir/lib/IR/MLIRContext.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,10 @@ MLIRContext::getOrLoadDialect(StringRef dialectNamespace, TypeID dialectID,
430430
"the PassManager): this can indicate a "
431431
"missing `dependentDialects` in a pass for example.");
432432
#endif // NDEBUG
433-
// nullptr indicates that the dialect is currently being loaded.
434-
impl.loadedDialects[dialectNamespace] = nullptr;
435-
std::unique_ptr<Dialect> &dialect = impl.loadedDialects[dialectNamespace] =
436-
ctor();
433+
// loadedDialects entry is initialized to nullptr, indicating that the
434+
// dialect is currently being loaded.
435+
std::unique_ptr<Dialect> &dialect = impl.loadedDialects[dialectNamespace];
436+
dialect = ctor();
437437
assert(dialect && "dialect ctor failed");
438438

439439
// Refresh all the identifiers dialect field, this catches cases where a

0 commit comments

Comments
 (0)