aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2025-07-04 04:29:35 -0700
committerMehdi Amini <joker.eph@gmail.com>2025-07-04 04:31:46 -0700
commit4a6d78e66c5689493019bacbc1351a3518f14b72 (patch)
tree445f077b1a2aca574e5d646d141c8a4b3d3073b1
parentd0db199bcc0efb39c4a6392ee2896d6b01fff7fc (diff)
downloadllvm-4a6d78e66c5689493019bacbc1351a3518f14b72.zip
llvm-4a6d78e66c5689493019bacbc1351a3518f14b72.tar.gz
llvm-4a6d78e66c5689493019bacbc1351a3518f14b72.tar.bz2
[MLIR][ODS] Improve diagnostic for using a property as an anchor
The diagnostic make it more clear that it does not have an optionalParser field defined. Fix #147020
-rw-r--r--mlir/tools/mlir-tblgen/OpFormatGen.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
index 14af778..67fc763 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -3779,7 +3779,8 @@ LogicalResult OpFormatParser::verifyOptionalGroupElement(SMLoc loc,
Property prop = propEle->getVar()->prop;
if (isAnchor && !(prop.hasDefaultValue() && prop.hasOptionalParser()))
return emitError(loc, "only properties with default values "
- "that can be optionally parsed "
+ "that can be optionally parsed (have the `let "
+ "optionalParser = ...` field defined) "
"can be used to anchor an optional group");
return success();
})