[Mlir-commits] [mlir] [mlir][emitc] Update the `WrapFuncInClassPass` pass (PR #179184)

Gil Rapaport llvmlistbot at llvm.org
Mon Feb 2 04:20:43 PST 2026


================
@@ -34,12 +36,11 @@ module attributes { } {
   }
 }
 
-// CHECK: module {
 // CHECK:   emitc.class @modelClass {
 // CHECK:     emitc.field @fieldName0 : !emitc.array<1xf32> {emitc.name_hint = "another_feature"}
 // CHECK:     emitc.field @fieldName1 : !emitc.array<1xf32>  {emitc.name_hint = "some_feature"}
 // CHECK:     emitc.field @fieldName2 : !emitc.array<1xf32>  {emitc.name_hint = "output_0"}
-// CHECK:     emitc.func @execute() {
+// CHECK:     emitc.func @operator() {
----------------
aniragil wrote:

Passing this code to the C++ translator yields:
```C++
class modelClass {
 public:
  float fieldName0[1];
  float fieldName1[1];
  float fieldName2[1];
  void operator() {
    return;
  }
};
```
which isn't valid C++ (the operator should be `operator()()`).

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


More information about the Mlir-commits mailing list