projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added initialization of fields
[libfirm]
/
ir
/
tr
/
entity.c
diff --git
a/ir/tr/entity.c
b/ir/tr/entity.c
index
7c57f22
..
5cf9e2e
100644
(file)
--- a/
ir/tr/entity.c
+++ b/
ir/tr/entity.c
@@
-36,7
+36,10
@@
init_entity (void)
/** ENTITY **/
/*******************************************************************/
/** 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;
INLINE void insert_entity_in_owner (entity *ent) {
type *owner = ent->owner;
@@
-85,6
+88,8
@@
new_entity (type *owner, ident *name, type *type)
current_ir_graph = rem;
} else {
res->variability = uninitialized;
current_ir_graph = rem;
} else {
res->variability = uninitialized;
+ res->value = NULL;
+ res->values = NULL;
}
res->peculiarity = existent;
res->volatility = non_volatile;
}
res->peculiarity = existent;
res->volatility = non_volatile;
@@
-142,6
+147,9
@@
copy_entity_own (entity *old, type *new_owner) {
new->overwrites = NEW_ARR_F(entity *, 1);
new->overwrittenby = NEW_ARR_F(entity *, 1);
}
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);
insert_entity_in_owner (new);
@@
-157,16
+165,23
@@
copy_entity_name (entity *old, ident *new_name) {
memcpy (new, old, sizeof (entity));
new->name = new_name;
new->ld_name = NULL;
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);
return new;
}
insert_entity_in_owner (new);
return new;
}
+
void
free_entity (entity *ent) {
void
free_entity (entity *ent) {
+ free_tv_entity(ent);
free_entity_attrs(ent);
free(ent);
}
free_entity_attrs(ent);
free(ent);
}