[Mlir-commits] [mlir] [MLIR][ODS] Add strict property assembly format mode (PR #196269)
Jacques Pienaar
llvmlistbot at llvm.org
Mon May 11 03:18:44 PDT 2026
================
@@ -55,6 +55,12 @@ class Dialect {
// dialect declaration.
code extraClassDeclaration = "";
+ // If this dialect should require declarative parsers for property-backed
+ // operations to bind every inherent attribute and property directly in the
+ // custom assembly format, or otherwise cover them with `prop-dict`. This
+ // stricter mode is disabled by default for now.
+ bit useStrictPropertiesInAssemblyFormat = 0;
----------------
jpienaar wrote:
> Technically all the fields on the dialect class that only affect the dialect-gen backend could be moved to be tblgen command line flags, so there is a large part of taste involved here.
This for me is a temporary staging option compared to the others. This is more akin to linter option or `-Wall -Werror` (and yes just like clang side these could be options or pragmas, but I feel pragmas are more invasive same as this). For this one I'd probably push even further as you want this to be default: the parser generator should always warn if this is not true (to help encourage migration), there can be a command line if this a warning or an error, and the default on warning or error can be flipped. This PR could only changes the generator to make warnings (no cmake or dialect changes). This also pushes the flagging to the dialects that need work rather than those already good.
> Also I don't think there is a precedent for this? Any other similar option?
Yes, `on-deprecated` and `asmformat-error-is-fatal`.
https://github.com/llvm/llvm-project/pull/196269
More information about the Mlir-commits
mailing list