Add the push operation in code in compiler series
This commit is contained in:
@@ -53,6 +53,7 @@ void definition_defn::compile() {
|
||||
}
|
||||
body->compile(new_env, instructions);
|
||||
instructions.push_back(instruction_ptr(new instruction_update(params.size())));
|
||||
instructions.push_back(instruction_ptr(new instruction_pop(params.size())));
|
||||
}
|
||||
void definition_defn::gen_llvm_first(llvm_context& ctx) {
|
||||
generated_function = ctx.create_custom_function(name, params.size());
|
||||
@@ -63,7 +64,6 @@ void definition_defn::gen_llvm_second(llvm_context& ctx) {
|
||||
for(auto& instruction : instructions) {
|
||||
instruction->gen_llvm(ctx, generated_function);
|
||||
}
|
||||
ctx.create_popn(generated_function, ctx.create_size(params.size()));
|
||||
ctx.builder.CreateRetVoid();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user