/** ENTITY **/
/*******************************************************************/
-INLINE type *get_entity_owner (entity *ent);
+/* redeclared to declare INLINE. */
+INLINE entity *get_entity_overwrites (entity *ent, int pos);
+INLINE entity *get_entity_overwrittenby (entity *ent, int pos);
+INLINE type *get_entity_owner (entity *ent);
INLINE void insert_entity_in_owner (entity *ent) {
type *owner = ent->owner;
new->overwrites = NEW_ARR_F(entity *, 1);
new->overwrittenby = NEW_ARR_F(entity *, 1);
}
+#ifdef DEBUG_libfirm
+ new->nr = get_irp_new_node_nr();
+#endif
insert_entity_in_owner (new);
memcpy (new, old, sizeof (entity));
new->name = new_name;
new->ld_name = NULL;
- new->overwrites = DUP_ARR_F(entity *, old->overwrites);
- new->overwrittenby = DUP_ARR_F(entity *, old->overwrittenby);
+ if (is_class_type(new->owner)) {
+ new->overwrites = DUP_ARR_F(entity *, old->overwrites);
+ new->overwrittenby = DUP_ARR_F(entity *, old->overwrittenby);
+ }
+#ifdef DEBUG_libfirm
+ new->nr = get_irp_new_node_nr();
+#endif
insert_entity_in_owner (new);
bool equal_entity(entity *ent1, entity *ent2);
+/** Outputs a unique number for this entity if libfirm is compiled for
+ debugging, (configure with --enable-debug) else returns 0. */
+INLINE long get_entity_nr(entity *ent);
+
unsigned long get_entity_visited(entity *ent);
void set_entity_visited(entity *ent, unsigned long num);
set_type_state(type *tp, type_state state) {
assert(tp && tp->kind == k_type);
- if ((tp->type_op == type_pointer) && (tp->type_op == type_primitive) &&
+ if ((tp->type_op == type_pointer) || (tp->type_op == type_primitive) ||
(tp->type_op == type_method))
return;
} break;
case tpo_struct:
{
- /* assert(get_type_size(tp) > -1); @@@ lowerfirm geht nicht durch */
+ assert(get_type_size(tp) > -1);
for (i = 0; i < get_struct_n_members(tp); i++) {
assert(get_entity_offset(get_struct_member(tp, i)) > -1);
assert((get_entity_allocation(get_struct_member(tp, i)) == automatic_allocated));
int is_compound_type(type *tp);
-/** Outputs a unique number for this node if libfirm is compiled for
+/** Outputs a unique number for this type if libfirm is compiled for
debugging, (configure with --enable-debug) else returns 0. */
INLINE long get_type_nr(type *tp);
type_walk_func *post,
void *env);
-/** walks over all type information reachable from irg */
+/** Walks over all type information reachable from an ir graph.
+ *
+ * Walks over all type information reachable from irg, i.e., starts a
+ * type walk at the irgs entity, the irgs frame type and all types and
+ * entities that are attributes to firm nodes. */
void type_walk_irg(ir_graph *irg,
type_walk_func *pre,
type_walk_func *post,