diff --git a/mlir/include/mlir/Dialect/LLVMIR/FunctionCallUtils.h b/mlir/include/mlir/Dialect/LLVMIR/FunctionCallUtils.h --- a/mlir/include/mlir/Dialect/LLVMIR/FunctionCallUtils.h +++ b/mlir/include/mlir/Dialect/LLVMIR/FunctionCallUtils.h @@ -60,7 +60,7 @@ /// Create a FuncOp with signature `resultType`(`paramTypes`)` and name `name`. LLVM::LLVMFuncOp lookupOrCreateFn(ModuleOp moduleOp, StringRef name, ArrayRef paramTypes = {}, - Type resultType = {}); + Type resultType = {}, bool isVarArg = false); } // namespace LLVM } // namespace mlir diff --git a/mlir/lib/Dialect/LLVMIR/IR/FunctionCallUtils.cpp b/mlir/lib/Dialect/LLVMIR/IR/FunctionCallUtils.cpp --- a/mlir/lib/Dialect/LLVMIR/IR/FunctionCallUtils.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/FunctionCallUtils.cpp @@ -45,14 +45,14 @@ /// Generic print function lookupOrCreate helper. LLVM::LLVMFuncOp mlir::LLVM::lookupOrCreateFn(ModuleOp moduleOp, StringRef name, ArrayRef paramTypes, - Type resultType) { + Type resultType, bool isVarArg) { auto func = moduleOp.lookupSymbol(name); if (func) return func; OpBuilder b(moduleOp.getBodyRegion()); return b.create( moduleOp->getLoc(), name, - LLVM::LLVMFunctionType::get(resultType, paramTypes)); + LLVM::LLVMFunctionType::get(resultType, paramTypes, isVarArg)); } LLVM::LLVMFuncOp mlir::LLVM::lookupOrCreatePrintI64Fn(ModuleOp moduleOp) {