mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-30 19:30:06 +00:00
Remove unneeded local_entity_map
This commit is contained in:
@@ -301,7 +301,6 @@ struct lbProcedure {
|
|||||||
lbBlock * curr_block;
|
lbBlock * curr_block;
|
||||||
lbTargetList * target_list;
|
lbTargetList * target_list;
|
||||||
PtrMap<Entity *, lbValue> direct_parameters;
|
PtrMap<Entity *, lbValue> direct_parameters;
|
||||||
PtrMap<Entity *, lbValue> local_entity_map;
|
|
||||||
|
|
||||||
Ast *curr_stmt;
|
Ast *curr_stmt;
|
||||||
|
|
||||||
|
|||||||
@@ -3404,11 +3404,7 @@ gb_internal lbAddr lb_build_addr_from_entity(lbProcedure *p, Entity *e, Ast *exp
|
|||||||
|
|
||||||
|
|
||||||
lbValue v = {};
|
lbValue v = {};
|
||||||
lbValue *found = nullptr;
|
lbValue *found = map_get(&p->module->values, e);
|
||||||
found = map_get(&p->local_entity_map, e);
|
|
||||||
if (found == nullptr) {
|
|
||||||
found = map_get(&p->module->values, e);
|
|
||||||
}
|
|
||||||
if (found) {
|
if (found) {
|
||||||
v = *found;
|
v = *found;
|
||||||
} else if (e->kind == Entity_Variable && e->flags & EntityFlag_Using) {
|
} else if (e->kind == Entity_Variable && e->flags & EntityFlag_Using) {
|
||||||
|
|||||||
@@ -2844,10 +2844,6 @@ gb_internal lbAddr lb_add_local(lbProcedure *p, Type *type, Entity *e, bool zero
|
|||||||
lb_mem_zero_ptr(p, ptr, type, alignment);
|
lb_mem_zero_ptr(p, ptr, type, alignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e != nullptr) {
|
|
||||||
map_set(&p->local_entity_map, e, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
return lb_addr(val);
|
return lb_addr(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -487,7 +487,6 @@ gb_internal void lb_begin_procedure_body(lbProcedure *p) {
|
|||||||
lb_start_block(p, p->entry_block);
|
lb_start_block(p, p->entry_block);
|
||||||
|
|
||||||
map_init(&p->direct_parameters, heap_allocator());
|
map_init(&p->direct_parameters, heap_allocator());
|
||||||
map_init(&p->local_entity_map, heap_allocator());
|
|
||||||
|
|
||||||
GB_ASSERT(p->type != nullptr);
|
GB_ASSERT(p->type != nullptr);
|
||||||
|
|
||||||
|
|||||||
@@ -1531,9 +1531,6 @@ gb_internal void lb_build_static_variables(lbProcedure *p, AstValueDecl *vd) {
|
|||||||
lbValue global_val = {global, alloc_type_pointer(e->type)};
|
lbValue global_val = {global, alloc_type_pointer(e->type)};
|
||||||
lb_add_entity(p->module, e, global_val);
|
lb_add_entity(p->module, e, global_val);
|
||||||
lb_add_member(p->module, mangled_name, global_val);
|
lb_add_member(p->module, mangled_name, global_val);
|
||||||
if (e) {
|
|
||||||
map_set(&p->local_entity_map, e, global_val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gb_internal void lb_append_tuple_values(lbProcedure *p, Array<lbValue> *dst_values, lbValue src_value) {
|
gb_internal void lb_append_tuple_values(lbProcedure *p, Array<lbValue> *dst_values, lbValue src_value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user