[Mlir-commits] [mlir] [mlir] Add the concept of ASM dialect aliases (PR #86033)

Markus Böck llvmlistbot at llvm.org
Thu Mar 28 09:18:56 PDT 2024


================
@@ -1729,6 +1732,29 @@ class OpAsmDialectInterface
     return AliasResult::NoAlias;
   }
 
+  /// Hooks for parsing a dialect alias. The method returns success if the
+  /// dialect has an alias for the symbol, otherwise it must return failure.
+  /// If there was an error during parsing, this method should return success
+  /// and set the attribute to null.
+  virtual LogicalResult parseDialectAlias(DialectAsmParser &parser,
+                                          Attribute &attr, Type type) const {
+    return failure();
+  }
+  virtual LogicalResult parseDialectAlias(DialectAsmParser &parser,
+                                          Type &type) const {
+    return failure();
+  }
+  /// Hooks for printing a dialect alias. The method returns success if the
+  /// dialect has an alias for the symbol, otherwise it must return failure.
+  virtual LogicalResult printDialectAlias(DialectAsmPrinter &printer,
+                                          Attribute attr) const {
+    return failure();
+  }
+  virtual LogicalResult printDialectAlias(DialectAsmPrinter &printer,
+                                          Type type) const {
+    return failure();
+  }
+
----------------
zero9178 wrote:

I'd personally not prefer to have these unless required. We can always add these once there is a use-case. I don't think they add much clarity. 

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


More information about the Mlir-commits mailing list