mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-16 10:52:22 -07:00
Change push allocator system; update core libraries
This commit is contained in:
-26
@@ -7251,32 +7251,6 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) {
|
||||
case_end;
|
||||
|
||||
|
||||
|
||||
case_ast_node(pa, PushAllocator, node);
|
||||
ir_emit_comment(proc, str_lit("push_allocator"));
|
||||
irValue *new_allocator = ir_build_expr(proc, pa->expr);
|
||||
|
||||
ir_open_scope(proc);
|
||||
|
||||
irValue *prev = ir_find_or_generate_context_ptr(proc);
|
||||
irValue *next = ir_add_local_generated(proc, t_context);
|
||||
ir_emit_store(proc, next, ir_emit_load(proc, prev));
|
||||
|
||||
Selection sel = lookup_field(proc->module->allocator, t_context, str_lit("allocator"), false);
|
||||
irValue *gep = ir_emit_deep_field_gep(proc, next, sel);
|
||||
ir_emit_store(proc, gep, new_allocator);
|
||||
|
||||
array_add(&proc->context_stack, next);
|
||||
defer (array_pop(&proc->context_stack));
|
||||
|
||||
// TODO(bill): is this too leaky?
|
||||
|
||||
ir_build_stmt(proc, pa->body);
|
||||
|
||||
ir_close_scope(proc, irDeferExit_Default, nullptr);
|
||||
case_end;
|
||||
|
||||
|
||||
case_ast_node(pc, PushContext, node);
|
||||
ir_emit_comment(proc, str_lit("push_context"));
|
||||
irValue *new_context = ir_build_expr(proc, pc->expr);
|
||||
|
||||
Reference in New Issue
Block a user