Store arity of functions in llvm context to generate correct calls.

This commit is contained in:
2019-06-12 04:11:28 -07:00
parent e6f31f8c5b
commit dbe7572eb5
5 changed files with 19 additions and 9 deletions

View File

@@ -109,7 +109,7 @@ namespace lily {
void instruction_push_global::gen_llvm(llvm_context& ctx) {
llvm::Value* stack = ctx.get_current_function()->arg_begin();
llvm::Value* new_node = builder.CreateCall(malloc_node_global_func,
{ get_int8_constant(2), ctx.get_supercombinator(name) }, "temp");
{ get_int8_constant(ctx.get_supercombinator_arity(name)), ctx.get_supercombinator_function(name) }, "temp");
// TODO get arity
builder.CreateCall(stack_push_func, { stack, new_node });
}