X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Fentity.c;h=f1fac56cb9c9f6b63ece78e4bb241ceb7ddf61c6;hb=f2edb6301aa7affb0673e76436d9b4dbaef6b9e1;hp=03086ae502acfb32379472af1d5a4ec9fb31a8d0;hpb=c28fcf22c08f71b02ccd8edb2e091c1b6c22e540;p=libfirm diff --git a/ir/tr/entity.c b/ir/tr/entity.c index 03086ae50..f1fac56cb 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -109,8 +109,9 @@ static INLINE void insert_entity_in_owner(ir_entity *ent) { case tpo_array: set_array_element_entity(owner, ent); break; + default: + panic("Unsupported type kind"); } - panic("Unsupported type kind"); } /* insert_entity_in_owner */ /** @@ -131,8 +132,7 @@ new_rd_entity(dbg_info *db, ir_type *owner, ident *name, ir_type *type) assert(!id_contains_char(name, ' ') && "entity name should not contain spaces"); - res = xmalloc(sizeof(*res)); - memset(res, 0, sizeof(*res)); + res = XMALLOCZ(ir_entity); res->kind = k_entity; res->name = name; @@ -266,7 +266,7 @@ copy_entity_own(ir_entity *old, ir_type *new_owner) { assert(get_type_state(new_owner) != layout_fixed); if (old->owner == new_owner) return old; - newe = xmalloc(sizeof(*newe)); + newe = XMALLOC(ir_entity); memcpy(newe, old, sizeof(*newe)); newe->owner = new_owner; if (is_Class_type(new_owner)) { @@ -288,7 +288,7 @@ copy_entity_name(ir_entity *old, ident *new_name) { assert(old && old->kind == k_entity); if (old->name == new_name) return old; - newe = xmalloc(sizeof(*newe)); + newe = XMALLOC(ir_entity); memcpy(newe, old, sizeof(*newe)); newe->name = new_name; newe->ld_name = NULL;