return new;
}
+void
+free_entity (entity *ent) {
+ /* @@@ */
+}
+
INLINE const char *
get_entity_name (entity *ent) {
assert (ent);
Automatically inserts the new entity as a member of owner.
The mangled name ld_name is set to NULL. */
entity *copy_entity_name (entity *old, ident *new_name);
+/* Frees the entity. The owner will still contain the pointer to this
+ entity, as well as all other references! */
+void free_entity (entity *ent);
/** manipulate fields of entity **/
const char *get_entity_name (entity *ent);
unsigned long type_visited;
-void
-free_type(type *tp) {
- /* @@@ not implemented */
+void free_type(type *tp) {
+ /* Remove from list of all types */
remove_irp_type(tp);
+ /* Free the attributes of the type. */
+ free_type_attrs(tp);
+ /* Free entities automatically allocated with the type */
+ if (is_array_type(tp))
+ free_entity(get_array_element_entity(tp));
+ /* And now the type itself... */
+ free(tp);
}
INLINE type *