[Mlir-commits] [mlir] [MLIR] Convert DialectReductionPatternInterface using ODS (PR #180640)

Jacques Pienaar llvmlistbot at llvm.org
Mon Feb 16 10:04:29 PST 2026


================
@@ -126,6 +131,27 @@ static void emitInterfaceMethodsDef(const DialectInterface &interface,
   }
 }
 
+static void emitConstructor(const DialectInterface &interface,
+                            raw_ostream &os) {
+
+  raw_indented_ostream ios(os);
+
+  // We consider a constructor protected if interface has at least one pure
+  // virtual method
+  auto hasProtectedConstructor =
+      llvm::any_of(interface.getMethods(), [](const InterfaceMethod &method) {
+        return method.isPureVirtual();
+      });
+
+  ios.indent(0);
+  if (hasProtectedConstructor)
+    ios << "protected:\n";
----------------
jpienaar wrote:

Given existing position, it doesn't make difference yes.

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


More information about the Mlir-commits mailing list