[Mlir-commits] [mlir] Add AsmParser::parseDecimalInteger. (PR #96255)

Jacques Pienaar llvmlistbot at llvm.org
Fri Jul 12 18:40:48 PDT 2024


================
@@ -64,6 +66,25 @@ void CompoundAAttr::print(AsmPrinter &printer) const {
 // CompoundAAttr
 //===----------------------------------------------------------------------===//
 
+
+Attribute TestDecimalIntegerAttr::parse(AsmParser &parser, Type type) {
+  if (parser.parseLess()){
+    return Attribute();
+  }
+  uint64_t intVal;
+  if (failed(*parser.parseOptionalDecimalInteger(intVal))) {
+    return Attribute();
+  }
+  if (parser.parseGreater()) {
----------------
jpienaar wrote:

Lets parse `x` and `a` (say) here too, that way you have a valid hex number and you verify that the reset worked as expected.

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


More information about the Mlir-commits mailing list