}));
}
- /// Return true if the given dialect is currently loading.
- bool isDialectLoading(StringRef dialectNamespace);
-
/// Load a dialect in the context.
template <typename Dialect>
void loadDialect() {
llvm::hash_code getRegistryHash();
private:
+ /// Return true if the given dialect is currently loading.
+ bool isDialectLoading(StringRef dialectNamespace);
+
const std::unique_ptr<MLIRContextImpl> impl;
MLIRContext(const MLIRContext &) = delete;
"the PassManager): this can indicate a "
"missing `dependentDialects` in a pass for example.");
#endif // NDEBUG
- // nullptr indicates that the dialect is currently being loaded.
- impl.loadedDialects[dialectNamespace] = nullptr;
- std::unique_ptr<Dialect> &dialect = impl.loadedDialects[dialectNamespace] =
- ctor();
+ // loadedDialects entry is initialized to nullptr, indicating that the
+ // dialect is currently being loaded.
+ std::unique_ptr<Dialect> &dialect = impl.loadedDialects[dialectNamespace];
+ dialect = ctor();
assert(dialect && "dialect ctor failed");
// Refresh all the identifiers dialect field, this catches cases where a