X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Fentity.c;h=88d0b991e2e615b641dc407b5e3fac65a1a2a46b;hb=0651be9698637d202db8d0acbda9597de4ca9a7c;hp=098543672d4589a1aaa411bd2a7be9063f0abaa7;hpb=5994fced0d4928121f9923d973688647fc3552f6;p=libfirm diff --git a/ir/tr/entity.c b/ir/tr/entity.c index 098543672..88d0b991e 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -97,7 +97,7 @@ ir_entity *new_d_entity(ir_type *owner, ident *name, ir_type *type, current_ir_graph = rem; res->linkage = IR_LINKAGE_CONSTANT; res->attr.mtd_attr.irg_add_properties = mtp_property_inherited; - res->attr.mtd_attr.vtable_number = VTABLE_NUM_NOT_SET; + res->attr.mtd_attr.vtable_number = IR_VTABLE_NUM_NOT_SET; res->attr.mtd_attr.param_access = NULL; res->attr.mtd_attr.param_weight = NULL; res->attr.mtd_attr.irg = NULL; @@ -239,7 +239,7 @@ ir_entity *copy_entity_name(ir_entity *old, ident *new_name) void free_entity(ir_entity *ent) { - if (! is_Array_type(ent->owner)) + if (ent->owner != NULL && !is_Array_type(ent->owner)) remove_compound_member(ent->owner, ent); assert(ent && ent->kind == k_entity); @@ -996,21 +996,23 @@ int entity_has_definition(const ir_entity *entity) || entity_has_compound_ent_values(entity); } -void firm_init_entity(void) +void ir_init_entity(void) { - symconst_symbol sym; - assert(firm_unknown_type && "Call init_type() before firm_init_entity()!"); assert(!unknown_entity && "Call firm_init_entity() only once!"); unknown_entity = new_d_entity(NULL, new_id_from_str(UNKNOWN_ENTITY_NAME), firm_unknown_type, NULL); set_entity_visibility(unknown_entity, ir_visibility_external); - set_entity_ld_ident(unknown_entity, get_entity_ident(unknown_entity)); +} - current_ir_graph = get_const_code_irg(); - sym.entity_p = unknown_entity; +void ir_finish_entity(void) +{ + if (unknown_entity != NULL) { + free_entity(unknown_entity); + unknown_entity = NULL; + } } ir_allocation get_entity_allocation(const ir_entity *entity)