Commit 45da009a authored by Matthias Braun's avatar Matthias Braun
Browse files

remove set_.*_member type functions, as you can too easily violate the owner...

remove set_.*_member type functions, as you can too easily violate the owner <-> member relationship

[r28120]
parent 84b7fa25
......@@ -1389,18 +1389,6 @@ FIRM_API int get_class_member_index(const ir_type *clss, ir_entity *mem);
* name returns one of them. Returns NULL if no member found. */
FIRM_API ir_entity *get_class_member_by_name(ir_type *clss, ident *name);
/** Overwrites the member at position pos, 0 <= pos < n_member with
* the passed entity. */
FIRM_API void set_class_member(ir_type *clss, ir_entity *member, int pos);
/** Replaces complete member list in class type by the list passed.
*
* Copies the list passed. This function is necessary to reduce the number of members.
* members is an array of entities, num the size of this array. Sets all
* owners of the members passed to clss. */
FIRM_API void set_class_members(ir_type *clss, ir_entity *members[], int arity);
/** Adds subtype as subtype to clss.
*
* Checks whether clss is a supertype of subtype. If not
......@@ -1542,10 +1530,6 @@ FIRM_API ir_entity *get_struct_member(const ir_type *strct, int pos);
/** Returns index of member in strct, -1 if not contained. */
FIRM_API int get_struct_member_index(const ir_type *strct, ir_entity *member);
/** Overwrites the member at position pos, 0 <= pos < n_member with
the passed entity. */
FIRM_API void set_struct_member(ir_type *strct, int pos, ir_entity *member);
/** Returns true if a type is a struct type. */
FIRM_API int is_Struct_type(const ir_type *strct);
......@@ -1817,9 +1801,6 @@ FIRM_API ir_entity *get_union_member(const ir_type *uni, int pos);
/** Returns index of member in uni, -1 if not contained. */
FIRM_API int get_union_member_index(const ir_type *uni, ir_entity *member);
/** Overwrites a entity at position pos in a union type. */
FIRM_API void set_union_member(ir_type *uni, int pos, ir_entity *member);
/** Returns true if a type is a union type. */
FIRM_API int is_Union_type(const ir_type *uni);
......
......@@ -824,25 +824,6 @@ ir_entity *get_class_member_by_name(ir_type *clss, ident *name)
return NULL;
}
void set_class_member(ir_type *clss, ir_entity *member, int pos)
{
assert(clss && (clss->type_op == type_class));
assert(pos >= 0 && pos < get_class_n_members(clss));
clss->attr.ca.members[pos] = member;
}
void set_class_members(ir_type *clss, ir_entity **members, int arity)
{
int i;
assert(clss && (clss->type_op == type_class));
DEL_ARR_F(clss->attr.ca.members);
clss->attr.ca.members = NEW_ARR_F(ir_entity *, 0);
for (i = 0; i < arity; ++i) {
set_entity_owner(members[i], clss);
ARR_APP1(ir_entity *, clss->attr.ca.members, members[i]);
}
}
static void remove_class_member(ir_type *clss, ir_entity *member)
{
int i;
......@@ -1135,14 +1116,6 @@ int get_struct_member_index(const ir_type *strct, ir_entity *mem)
return -1;
}
void set_struct_member(ir_type *strct, int pos, ir_entity *member)
{
assert(strct && (strct->type_op == type_struct));
assert(pos >= 0 && pos < get_struct_n_members(strct));
assert(get_entity_type(member)->type_op != type_method);/* @@@ lowerfirm !!*/
strct->attr.sa.members[pos] = member;
}
static void remove_struct_member(ir_type *strct, ir_entity *member)
{
int i;
......@@ -1599,13 +1572,6 @@ int get_union_member_index(const ir_type *uni, ir_entity *mem)
return -1;
}
void set_union_member(ir_type *uni, int pos, ir_entity *member)
{
assert(uni && (uni->type_op == type_union));
assert(pos >= 0 && pos < get_union_n_members(uni));
uni->attr.ua.members[pos] = member;
}
static void remove_union_member(ir_type *uni, ir_entity *member)
{
int i;
......
Markdown is supported
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