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

Fabian Mora llvmlistbot at llvm.org
Thu Mar 28 09:31:06 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();
+  }
+
----------------
fabianmcg wrote:

If the plan is eventually doing ODS, then I agree these should be removed.

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


More information about the Mlir-commits mailing list