[Mlir-commits] [mlir] [mlir][emitC] Add support to emitter for `classop`, `fieldop` and `getfieldop` (PR #145605)

Marius Brehler llvmlistbot at llvm.org
Thu Jun 26 02:31:46 PDT 2025


================
@@ -997,6 +997,61 @@ static LogicalResult printOperation(CppEmitter &emitter, ModuleOp moduleOp) {
   return success();
 }
 
+static LogicalResult printOperation(CppEmitter &emitter, ClassOp classOp) {
+  CppEmitter::Scope classScope(emitter);
+  raw_indented_ostream &os = emitter.ostream();
+  os << "class " << classOp.getSymName() << " final {\n";
----------------
marbre wrote:

Yes, this could either be an attribute of type `::mlir::UnitAttr` or implemented similar to the `specifiers` attribute (type `::mlir::ArrayAttr`) of the [`emitc::FuncOp`](https://mlir.llvm.org/docs/Dialects/EmitC/#emitcfunc-emitcfuncop).

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


More information about the Mlir-commits mailing list