[Mlir-commits] [mlir] [MLIR] Check that the prop-dict dictionnary does not have extra unknown entries (PR #138668)

Matthias Springer llvmlistbot at llvm.org
Tue May 6 03:51:43 PDT 2025


================
@@ -1374,7 +1381,14 @@ if (attr || /*isRequired=*/{1}) {{
 )decl",
                     namedAttr.name, isRequired);
   }
-  body << "return ::mlir::success();\n";
+  body << R"decl(
+for (NamedAttribute attr : dict) {
+  if (!usedKeys.contains(attr.getName()))
+    return emitError() << "Unknown key '" << attr.getName() <<
+        "' when parsing properties dictionnary";
----------------
matthias-springer wrote:

typo

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


More information about the Mlir-commits mailing list