Fix unwind bug and add eval.

This commit is contained in:
2019-06-12 03:33:35 -07:00
parent 37f5e53a59
commit e6f31f8c5b
6 changed files with 28 additions and 27 deletions

View File

@@ -140,7 +140,10 @@ namespace lily {
}
void instruction_eval::gen_llvm(llvm_context& ctx) {
// ??
llvm::Value* stack = ctx.get_current_function()->arg_begin();
llvm::Value* top = builder.CreateCall(stack_pop_func, { stack }, "temp");
llvm::Value* evaluated = builder.CreateCall(eval_func, { top }, "temp");
builder.CreateCall(stack_push_func, { stack, evaluated });
}
void instruction_op::gen_llvm(llvm_context& ctx) {