[Mlir-commits] [mlir] [mlir][tblgen] Add custom parsing and printing within struct (PR #133939)
Jorn Tuyls
llvmlistbot at llvm.org
Mon Apr 7 14:10:38 PDT 2025
================
@@ -316,6 +316,33 @@ static ParseResult parseCustomFloatAttr(AsmParser &p, StringAttr &typeStrAttr,
return success();
}
+//===----------------------------------------------------------------------===//
+// TestCustomStructAttr
+//===----------------------------------------------------------------------===//
+
+static void printCustomStructAttr(AsmPrinter &p, int64_t value) {
+ p.printStrippedAttrOrType(value);
+}
+
+static ParseResult parseCustomStructAttr(AsmParser &p, int64_t &value) {
+ if (failed(p.parseInteger(value))) {
+ return failure();
+ }
----------------
jtuyls wrote:
Thanks, just went with `p.parseInteger(value)`
https://github.com/llvm/llvm-project/pull/133939
More information about the Mlir-commits
mailing list