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

Jacques Pienaar llvmlistbot at llvm.org
Tue May 6 22:19:52 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() <<
----------------
jpienaar wrote:

s/Unknown/unknown/ (https://llvm.org/docs/CodingStandards.html#error-and-warning-messages)

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


More information about the Mlir-commits mailing list