Remove unused variable.
[libfirm] / ir / tr / entity.c
index ba7bd97..a02b8e1 100644 (file)
@@ -23,9 +23,7 @@
  * @author  Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Michael Beck
  * @version $Id$
  */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include <string.h>
 #include <stdlib.h>
@@ -45,8 +43,8 @@
 #include "tv_t.h"
 #include "irdump.h"
 #include "irgraph_t.h"
-
 #include "callgraph.h"
+#include "error.h"
 
 /**
  * An interval initializer.
@@ -94,7 +92,7 @@ ir_entity *get_unknown_entity(void) { return unknown_entity; }
 /**
  * Add an entity to it's already set owner type.
  */
-static INLINE void insert_entity_in_owner(ir_entity *ent) {
+static inline void insert_entity_in_owner(ir_entity *ent) {
        ir_type *owner = ent->owner;
        switch (get_type_tpop_code(owner)) {
        case tpo_class:
@@ -109,7 +107,8 @@ static INLINE void insert_entity_in_owner(ir_entity *ent) {
        case tpo_array:
                set_array_element_entity(owner, ent);
                break;
-       default: assert(0);
+       default:
+               panic("Unsupported type kind");
        }
 }  /* insert_entity_in_owner */
 
@@ -123,7 +122,7 @@ static INLINE void insert_entity_in_owner(ir_entity *ent) {
  *
  * @return the new created entity
  */
-static INLINE ir_entity *
+static inline ir_entity *
 new_rd_entity(dbg_info *db, ir_type *owner, ident *name, ir_type *type)
 {
        ir_entity *res;
@@ -131,8 +130,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 +264,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 +286,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;