Change find_or_generator_context_ptr behaviours

This commit is contained in:
gingerBill
2020-04-17 14:02:45 +01:00
parent 4438b3e7af
commit 92402603b9
2 changed files with 2 additions and 6 deletions
-1
View File
@@ -3115,7 +3115,6 @@ irValue *ir_find_or_generate_context_ptr(irProcedure *proc) {
irValue *c = ir_add_local_generated(proc, t_context, true);
ir_push_context_onto_stack(proc, c);
ir_emit_store(proc, c, ir_emit_load(proc, proc->module->global_default_context));
ir_emit_init_context(proc, c);
return c;
}
+2 -5
View File
@@ -6039,14 +6039,11 @@ lbAddr lb_find_or_generate_context_ptr(lbProcedure *p) {
Type *pt = base_type(p->type);
GB_ASSERT(pt->kind == Type_Proc);
if (pt->Proc.calling_convention != ProcCC_Odin) {
return p->module->global_default_context;
} else {
{
lbAddr c = lb_add_local_generated(p, t_context, false);
c.kind = lbAddr_Context;
lb_push_context_onto_stack(p, c);
lb_addr_store(p, c, lb_addr_load(p, p->module->global_default_context));
lb_emit_init_context(p, c);
lb_push_context_onto_stack(p, c);
return c;
}
}