[Mlir-commits] [mlir] [mlir][emitc]: support method calls in CallOpaqueOp (PR #200057)
Jacques Pienaar
llvmlistbot at llvm.org
Mon Jun 1 01:50:33 PDT 2026
================
@@ -355,7 +355,40 @@ def EmitC_CallOpaqueOp : EmitC_Op<"call_opaque", [CExpressionInterface]> {
];
let assemblyFormat = [{
- $callee `(` $operands `)` attr-dict `:` functional-type($operands, results)
+ $callee `(` $operands `)` prop-dict attr-dict `:` functional-type($operands, results)
+ }];
+ let hasVerifier = 1;
+}
+
+def EmitC_MemberCallOpaqueOp : EmitC_Op<"member_call_opaque", [CExpressionInterface]> {
+ let summary = "Opaque member call operation";
+ let description = [{
+ The `emitc.member_call_opaque` operation represents a C++ member function
+ call. It takes a receiver operand, a callee string attribute (the method
+ name), and variadic operands for arguments.
+
+ The call allows specifying order of operands and attributes in the call as
+ follows:
+ - integer value of index type refers to an argument operand;
+ - attribute which will get lowered to constant value in call;
+
+ Example:
+
+ ```mlir
+ %0 = emitc.member_call_opaque %receiver "method" (%arg0, %arg1) : !emitc.opaque<"MyClass">, (i32, i32) -> i32
+ ```
+ }];
+ let arguments = (ins
+ EmitCType:$receiver,
+ StrAttr:$callee,
+ OptionalAttr<ArrayAttr>:$args,
+ OptionalAttr<ArrayAttr>:$template_args,
+ Variadic<EmitCType>:$args_operands
----------------
jpienaar wrote:
arg_operands ? Consistent with template_args and the former makes me think its saying each argument has multiple operands. BUT non-native speaker here :)
https://github.com/llvm/llvm-project/pull/200057
More information about the Mlir-commits
mailing list