Commit 51977d52 authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

Fixed entity_nr in copy methods

Visibility of type/entity nr, comments

[r826]
parent ba4f8f4a
......@@ -36,7 +36,10 @@ init_entity (void)
/** 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;
......@@ -142,6 +145,9 @@ copy_entity_own (entity *old, type *new_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);
......@@ -157,8 +163,13 @@ copy_entity_name (entity *old, ident *new_name) {
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);
......
......@@ -325,6 +325,10 @@ int is_compound_entity(entity *ent);
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);
......
......@@ -212,7 +212,7 @@ void
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;
......@@ -232,7 +232,7 @@ set_type_state(type *tp, type_state state) {
} 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));
......
......@@ -610,7 +610,7 @@ int is_atomic_type(type *tp);
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);
......
......@@ -49,7 +49,11 @@ void type_walk(type_walk_func *pre,
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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment