Remove unneeded local_entity_map

This commit is contained in:
gingerBill
2023-01-02 15:40:25 +00:00
parent 529383f5b1
commit fa562ec5d6
5 changed files with 1 additions and 14 deletions

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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) {