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;
}
} /* 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));
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);