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

Tobias Gysi llvmlistbot at llvm.org
Sat Dec 23 00:06:14 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:

I very much agree with Ivan that there should be an assert that checks that `callee` is non-null and possibly an alternative builder signature that does not take a `callee`. Alternatively, the function type could also be computed outside of the builder. However, I think it is fine to add a new builder signature that does this for us. 



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


More information about the Mlir-commits mailing list