mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 09:24:33 +00:00
Remove unneeded local_entity_map
This commit is contained in:
@@ -301,7 +301,6 @@ struct lbProcedure {
|
||||
lbBlock * curr_block;
|
||||
lbTargetList * target_list;
|
||||
PtrMap<Entity *, lbValue> direct_parameters;
|
||||
PtrMap<Entity *, lbValue> local_entity_map;
|
||||
|
||||
Ast *curr_stmt;
|
||||
|
||||
|
||||
@@ -3404,11 +3404,7 @@ gb_internal lbAddr lb_build_addr_from_entity(lbProcedure *p, Entity *e, Ast *exp
|
||||
|
||||
|
||||
lbValue v = {};
|
||||
lbValue *found = nullptr;
|
||||
found = map_get(&p->local_entity_map, e);
|
||||
if (found == nullptr) {
|
||||
found = map_get(&p->module->values, e);
|
||||
}
|
||||
lbValue *found = map_get(&p->module->values, e);
|
||||
if (found) {
|
||||
v = *found;
|
||||
} 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);
|
||||
}
|
||||
|
||||
if (e != nullptr) {
|
||||
map_set(&p->local_entity_map, e, 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);
|
||||
|
||||
map_init(&p->direct_parameters, heap_allocator());
|
||||
map_init(&p->local_entity_map, heap_allocator());
|
||||
|
||||
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)};
|
||||
lb_add_entity(p->module, e, 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) {
|
||||
|
||||
Reference in New Issue
Block a user