[Mlir-commits] [mlir] [mlir][emitc]: support method calls in CallOpaqueOp (PR #200057)
Jeremy Kun
llvmlistbot at llvm.org
Tue Jun 2 07:08:12 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
----------------
j2kun wrote:
Fixed
https://github.com/llvm/llvm-project/pull/200057
More information about the Mlir-commits
mailing list