[Mlir-commits] [mlir] [mlir] load dialect in parser for optional parameters (PR #96667)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Fri Jun 28 14:44:16 PDT 2024


================
@@ -424,9 +424,11 @@ void DefFormat::genVariableParser(ParameterElement *el, FmtContext &ctx,
         Dialect dialect(dialectInit->getDef());
         auto cppNamespace = dialect.getCppNamespace();
         std::string name = dialect.getCppClassName();
-        dialectLoading = ("\nodsParser.getContext()->getOrLoadDialect<" +
-                          cppNamespace + "::" + name + ">();")
-                             .str();
+        if (name != "BuiltinDialect" || cppNamespace != "::mlir") {
----------------
ftynse wrote:

I don't quite understand the second part of the condition. Why don't we want to load the dialect if its namespace starts with `::mlir`? These shouldn't be anyhow special.

https://github.com/llvm/llvm-project/pull/96667


More information about the Mlir-commits mailing list