[Mlir-commits] [llvm] [mlir] [MLIR] convert OpAsmDialectInterface using ODS (PR #171488)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Dec 18 01:45:20 PST 2025


================
@@ -85,6 +85,16 @@ class StaticInterfaceMethod<string desc, string retTy, string methodName,
     : InterfaceMethod<desc, retTy, methodName, args, methodBody,
                       defaultImplementation>;
 
+// This class represents a pure virtual interface method.
+class PureVirtualInterfaceMethod<string desc, string retTy, string methodName,
+                            dag args = (ins)>
+    : InterfaceMethod<desc, retTy, methodName, args>;
----------------
aidint wrote:

It is, yet I use it only as a semantic differentiator later here: 
https://github.com/aidint/llvm-project/blob/c5a2c3cb4132509f1a13057b0528076c4b9f3286/mlir/lib/TableGen/Interfaces.cpp#L57

I didn’t want to break the InterfaceMethod class in `mlir/include/mlir/TableGen/Interfaces.h`. It contains methods that retrieve the method body, and removing the body from these newly created tablegen classes would cause those methods to break.

An alternative would have been to introduce a new class (say, DialectInterfaceMethod) that is largely identical but omits some of these capabilities. However, that would have led to a significant amount of duplication, which I wanted to avoid.

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


More information about the Mlir-commits mailing list