[Mlir-commits] [mlir] [MLIR][LLVM] Add vararg support in LLVM::LLVMFuncOp (PR #67274)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Sep 25 02:20:52 PDT 2023


================
@@ -962,19 +972,48 @@ void CallOp::build(OpBuilder &builder, OperationState &state, TypeRange results,
 
 void CallOp::build(OpBuilder &builder, OperationState &state, TypeRange results,
                    FlatSymbolRefAttr callee, ValueRange args) {
-  build(builder, state, results, callee, args, /*fastmathFlags=*/nullptr,
+  Type resultType;
+  if (results.empty())
+    resultType = LLVMVoidType::get(builder.getContext());
+  else
+    resultType = results.front();
+  std::vector<Type> argTypes(args.getTypes().begin(), args.getTypes().end());
----------------
ftynse wrote:

`std::vector` is discouraged in LLVM codebase, use `SmallVector` instead unless there is a specific reason not to. Also use `llvm::to_vector` to convert a range into a vector.

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


More information about the Mlir-commits mailing list