* @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>
#include "tv_t.h"
#include "irdump.h"
#include "irgraph_t.h"
-
#include "callgraph.h"
+#include "error.h"
/**
* An interval initializer.
/**
* 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:
case tpo_array:
set_array_element_entity(owner, ent);
break;
- default: assert(0);
+ default:
+ panic("Unsupported type kind");
}
} /* insert_entity_in_owner */
*
* @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;
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;
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)) {
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;