From f7e4433a1dacbab63a459bc936d42a1e7267d7cb Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 17 Jun 2024 11:47:17 -0400 Subject: [PATCH] xo-jit: fix Lambda generation to handle multiple arguments --- src/jit/MachPipeline.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jit/MachPipeline.cpp b/src/jit/MachPipeline.cpp index 68d8a127..1619d121 100644 --- a/src/jit/MachPipeline.cpp +++ b/src/jit/MachPipeline.cpp @@ -155,7 +155,7 @@ namespace xo { /** establish prototype for this function **/ // PLACEHOLDER - // just make prototype for function :: double -> double + // just make prototype for function :: double^n -> double TypeDescr fn_td = expr->value_td(); int n_fn_arg = fn_td->n_fn_arg(); @@ -307,7 +307,8 @@ namespace xo { // PLACEHOLDER // just handle double arguments + return type for now - std::vector double_v(1, llvm::Type::getDoubleTy(llvm_cx_->llvm_cx_ref())); + std::vector double_v(lambda->n_arg(), + llvm::Type::getDoubleTy(llvm_cx_->llvm_cx_ref())); auto * llvm_fn_type = llvm::FunctionType::get(llvm::Type::getDoubleTy(llvm_cx_->llvm_cx_ref()), double_v,