[Mlir-commits] [mlir] [mlir][llvm] Fixes CallOp builder for the case of indirect call (PR #76240)

Tobias Gysi llvmlistbot at llvm.org
Mon Dec 25 07:38:34 PST 2023


================
@@ -908,8 +908,9 @@ void CallOp::build(OpBuilder &builder, OperationState &state, TypeRange results,
 
 void CallOp::build(OpBuilder &builder, OperationState &state, TypeRange results,
                    FlatSymbolRefAttr callee, ValueRange args) {
+  auto fargs = callee ? args : args.drop_front();
----------------
gysit wrote:

`getCalleeFunctionType` seems to be able to work with a `callee_type` set to null (there is an if else specifically for this as far as I can see). It essentially takes the function arguments and results to build the correct type for a non-variadic function. However, I think the question is not relevant for this revision and it does not hurt to set the `callee_type` either.

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


More information about the Mlir-commits mailing list