[Mlir-commits] [llvm] [mlir] [MLIR] convert OpAsmDialectInterface using ODS (PR #171488)
Jacques Pienaar
llvmlistbot at llvm.org
Tue Jan 6 00:48:13 PST 2026
================
@@ -147,9 +157,17 @@ class TypeInterface<string name, list<Interface> baseInterfaces = []>
!if(!empty(cppNamespace),"", cppNamespace # "::") # name
>;
+// AliasDeclaration represents an Alias Declaration in a Dialect Interface
----------------
jpienaar wrote:
I think this is overkill at the moment given need, and can be handled with extraClass and changing two types. E.g., looking at equivalent C++ changes:
```
llvm-project/mlir/include/mlir/IR/OpImplementation.h
@@ -1786,16 +1786,14 @@ class OpAsmDialectInterface
public:
OpAsmDialectInterface(Dialect *dialect) : Base(dialect) {}
- using AliasResult = OpAsmAliasResult;
-
/// Hooks for getting an alias identifier alias for a given symbol, that is
/// not necessarily a part of this dialect. The identifier is used in place of
/// the symbol when printing textual IR. These aliases must not contain `.` or
/// end with a numeric digit([0-9]+).
- virtual AliasResult getAlias(Attribute attr, raw_ostream &os) const {
+ virtual OpAsmAliasResult getAlias(Attribute attr, raw_ostream &os) const {
return AliasResult::NoAlias;
}
- virtual AliasResult getAlias(Type type, raw_ostream &os) const {
+ virtual OpAsmAliasResult getAlias(Type type, raw_ostream &os) const {
return AliasResult::NoAlias;
}
@@ -1833,6 +1831,8 @@ public:
buildResources(Operation *op,
const SetVector<AsmDialectResourceHandle> &referencedResources,
AsmResourceBuilder &builder) const {}
+
+ using AliasResult = OpAsmAliasResult;
};
```
I'd revisit if there were more such cases or need. But currently this seems like only one and I'd prefer keeping it simpler.
https://github.com/llvm/llvm-project/pull/171488
More information about the Mlir-commits
mailing list