[Mlir-commits] [mlir] [MLIR] Fix a problem with parseOptionalAttribute (PR #188125)

Mehdi Amini llvmlistbot at llvm.org
Tue Mar 24 02:57:01 PDT 2026


================
@@ -1156,17 +1156,32 @@ class AsmParser {
   virtual OptionalParseResult parseOptionalAttribute(SymbolRefAttr &result,
                                                      Type type = {}) = 0;
 
+  /// Parse an optional attribute that must begin with a '#' hash identifier
+  /// (i.e. `#dialect.mnemonic<...>`). Returns std::nullopt if the next token
+  /// is not a hash identifier, without consuming any tokens.
+  virtual OptionalParseResult parseOptionalHashAttribute(Attribute &result,
+                                                         Type type = {}) = 0;
----------------
joker-eph wrote:

This method is confusing to me, I don't fully grasp the patch at the moment.

Can you please provide a test in the test dialect so we'll take it from there?

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


More information about the Mlir-commits mailing list