diff options
author | Mehdi Amini <joker.eph@gmail.com> | 2025-07-04 04:29:35 -0700 |
---|---|---|
committer | Mehdi Amini <joker.eph@gmail.com> | 2025-07-04 04:31:46 -0700 |
commit | 4a6d78e66c5689493019bacbc1351a3518f14b72 (patch) | |
tree | 445f077b1a2aca574e5d646d141c8a4b3d3073b1 | |
parent | d0db199bcc0efb39c4a6392ee2896d6b01fff7fc (diff) | |
download | llvm-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.cpp | 3 |
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(); }) |