Fixed and simplified rot matcher
[libfirm] / ir / tr / entity.c
index fcc3660..b3f5808 100644 (file)
@@ -170,7 +170,6 @@ new_rd_entity(dbg_info *db, ir_type *owner, ident *name, ir_type *type)
                res->attr.mtd_attr.param_access       = NULL;
                res->attr.mtd_attr.param_weight       = NULL;
                res->attr.mtd_attr.irg                = NULL;
-               res->attr.mtd_attr.section            = section_text;
        } else if (is_compound_type(type)) {
                res->variability = variability_uninitialized;
                res->value       = NULL;
@@ -255,11 +254,16 @@ static void free_entity_attrs(ir_entity *ent) {
        }
 }  /* free_entity_attrs */
 
+/*
+ * Copies the entity if the new_owner is different from the
+ * owner of the old entity,  else returns the old entity.
+ */
 ir_entity *
 copy_entity_own(ir_entity *old, ir_type *new_owner) {
        ir_entity *newe;
        assert(is_entity(old));
        assert(is_compound_type(new_owner));
+       assert(get_type_state(new_owner) != layout_fixed);
 
        if (old->owner == new_owner) return old;
        newe = xmalloc(sizeof(*newe));
@@ -1326,18 +1330,6 @@ void set_entity_vtable_number(ir_entity *ent, unsigned vtable_number) {
        ent->attr.mtd_attr.vtable_number = vtable_number;
 }  /* set_entity_vtable_number */
 
-/* Returns the section of a method. */
-ir_img_section get_method_img_section(const ir_entity *ent) {
-       assert(is_method_entity((ir_entity *)ent));
-       return ent->attr.mtd_attr.section;
-}  /* get_method_img_section */
-
-/* Sets the section of a method. */
-void set_method_img_section(ir_entity *ent, ir_img_section section) {
-       assert(is_method_entity(ent));
-       ent->attr.mtd_attr.section = section;
-}  /* set_method_img_section */
-
 int
 (is_entity)(const void *thing) {
        return _is_entity(thing);