Commit 302e20bf authored by Matthias Braun's avatar Matthias Braun
Browse files

coding style cleanup, use C99

parent 09f2dc24
......@@ -41,10 +41,9 @@ ir_entity *get_unknown_entity(void)
static ir_entity *intern_new_entity(ir_type *owner, ir_entity_kind kind,
ident *name, ir_type *type, dbg_info *dbgi)
{
assert(owner);
assert(owner != NULL);
ir_entity *res = XMALLOCZ(ir_entity);
res->kind = k_entity;
res->name = name;
res->ld_name = NULL;
......@@ -79,7 +78,6 @@ ir_entity *new_d_entity(ir_type *owner, ident *name, ir_type *type,
dbg_info *db)
{
ir_entity *res;
if (is_Method_type(type)) {
ir_graph *irg = get_const_code_irg();
symconst_symbol sym;
......@@ -205,16 +203,14 @@ static ir_entity *deep_entity_copy(ir_entity *old)
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;
/* create a deep copy so we are safe of aliasing and double-freeing. */
newe = deep_entity_copy(old);
ir_entity *newe = deep_entity_copy(old);
newe->owner = new_owner;
add_compound_member(new_owner, newe);
......@@ -223,14 +219,12 @@ ir_entity *copy_entity_own(ir_entity *old, ir_type *new_owner)
ir_entity *copy_entity_name(ir_entity *old, ident *new_name)
{
ir_entity *newe;
assert(old && old->kind == k_entity);
assert(old->kind == k_entity);
if (old->name == new_name)
return old;
newe = deep_entity_copy(old);
newe->name = new_name;
ir_entity *newe = deep_entity_copy(old);
newe->name = new_name;
newe->ld_name = NULL;
add_compound_member(old->owner, newe);
......@@ -242,7 +236,7 @@ void free_entity(ir_entity *ent)
if (is_compound_type(ent->owner))
remove_compound_member(ent->owner, ent);
assert(ent && ent->kind == k_entity);
assert(ent->kind == k_entity);
free_entity_attrs(ent);
#ifdef DEBUG_libfirm
ent->kind = k_BAD;
......@@ -252,7 +246,7 @@ void free_entity(ir_entity *ent)
long get_entity_nr(const ir_entity *ent)
{
assert(ent && ent->kind == k_entity);
assert(ent->kind == k_entity);
#ifdef DEBUG_libfirm
return ent->nr;
#else
......@@ -349,9 +343,9 @@ const char *get_volatility_name(ir_volatility var)
switch (var) {
X(volatility_non_volatile);
X(volatility_is_volatile);
default: return "BAD VALUE";
}
#undef X
return "BAD VALUE";
}
ir_align (get_entity_aligned)(const ir_entity *ent)
......@@ -380,9 +374,9 @@ const char *get_align_name(ir_align a)
switch (a) {
X(align_non_aligned);
X(align_is_aligned);
default: return "BAD VALUE";
}
#undef X
return "BAD VALUE";
}
void set_entity_label(ir_entity *ent, ir_label_t label)
......@@ -451,7 +445,7 @@ ir_node *get_atomic_ent_value(const ir_entity *entity)
{
ir_initializer_t *initializer = get_entity_initializer(entity);
assert(entity && is_atomic_entity(entity));
assert(is_atomic_entity(entity));
if (initializer == NULL) {
ir_type *type = get_entity_type(entity);
return new_r_Unknown(get_const_code_irg(), get_type_mode(type));
......@@ -478,20 +472,16 @@ ir_node *get_atomic_ent_value(const ir_entity *entity)
void set_atomic_ent_value(ir_entity *entity, ir_node *val)
{
ir_initializer_t *initializer;
assert(is_atomic_entity(entity));
assert(is_Dummy(val) || get_irn_mode(val) == get_type_mode(entity->type));
initializer = create_initializer_const(val);
ir_initializer_t *initializer = create_initializer_const(val);
entity->initializer = initializer;
}
int is_irn_const_expression(ir_node *n)
{
/* we are in danger iff an exception will arise. TODO: be more precisely,
* for instance Div. will NOT rise if divisor != 0
*/
* for instance Div. will NOT rise if divisor != 0 */
if (is_binop(n) && !is_fragile_op(n))
return is_irn_const_expression(get_binop_left(n)) && is_irn_const_expression(get_binop_right(n));
......@@ -511,13 +501,11 @@ int is_irn_const_expression(ir_node *n)
ir_node *copy_const_value(dbg_info *dbg, ir_node *n, ir_node *block)
{
ir_graph *irg = get_irn_irg(block);
ir_node *nn;
ir_mode *m;
/* @@@ GL I think we should implement this using the routines from irgopt for
dead node elimination/inlineing. */
m = get_irn_mode(n);
/* @@@ GL I think we should implement this using the routines from irgopt
* for dead node elimination/inlineing. */
ir_mode *m = get_irn_mode(n);
ir_node *nn;
switch (get_irn_opcode(n)) {
case iro_Const:
nn = new_rd_Const(dbg, irg, get_Const_tarval(n));
......@@ -568,7 +556,8 @@ ir_node *copy_const_value(dbg_info *dbg, ir_node *n, ir_node *block)
copy_const_value(dbg, get_Not_op(n), block), m);
break;
case iro_Unknown:
nn = new_r_Unknown(irg, m); break;
nn = new_r_Unknown(irg, m);
break;
default:
panic("opcode invalid or not implemented %+F", n);
}
......@@ -583,9 +572,9 @@ const char *get_initializer_kind_name(ir_initializer_kind_t ini)
X(IR_INITIALIZER_TARVAL);
X(IR_INITIALIZER_NULL);
X(IR_INITIALIZER_COMPOUND);
default: return "BAD VALUE";
}
#undef X
return "BAD VALUE";
}
static ir_initializer_t null_initializer = { IR_INITIALIZER_NULL };
......@@ -623,17 +612,16 @@ ir_initializer_t *create_initializer_compound(size_t n_entries)
{
struct obstack *obst = get_irg_obstack(get_const_code_irg());
size_t i;
size_t size = sizeof(ir_initializer_compound_t)
+ n_entries * sizeof(ir_initializer_t*)
- sizeof(ir_initializer_t*);
size_t size = sizeof(ir_initializer_compound_t)
+ n_entries * sizeof(ir_initializer_t*)
- sizeof(ir_initializer_t*);
ir_initializer_t *initializer
= (ir_initializer_t*)obstack_alloc(obst, size);
initializer->kind = IR_INITIALIZER_COMPOUND;
initializer->compound.n_initializers = n_entries;
for (i = 0; i < n_entries; ++i) {
for (size_t i = 0; i < n_entries; ++i) {
initializer->compound.initializers[i] = get_initializer_null();
}
......@@ -762,9 +750,7 @@ size_t get_entity_n_overwrites(const ir_entity *ent)
size_t get_entity_overwrites_index(const ir_entity *ent, ir_entity *overwritten)
{
size_t i;
size_t n = get_entity_n_overwrites(ent);
for (i = 0; i < n; ++i) {
for (size_t i = 0, n = get_entity_n_overwrites(ent); i < n; ++i) {
if (get_entity_overwrites(ent, i) == overwritten)
return i;
}
......@@ -785,9 +771,7 @@ void set_entity_overwrites(ir_entity *ent, size_t pos, ir_entity *overwritten)
void remove_entity_overwrites(ir_entity *ent, ir_entity *overwritten)
{
size_t i;
size_t n = get_entity_n_overwrites(ent);
for (i = 0; i < n; ++i) {
for (size_t i = 0, n = get_entity_n_overwrites(ent); i < n; ++i) {
if (ent->overwrites[i] == overwritten) {
for (; i < n - 1; i++)
ent->overwrites[i] = ent->overwrites[i+1];
......@@ -808,9 +792,7 @@ size_t get_entity_n_overwrittenby(const ir_entity *ent)
size_t get_entity_overwrittenby_index(const ir_entity *ent,
ir_entity *overwrites)
{
size_t i;
size_t n = get_entity_n_overwrittenby(ent);
for (i = 0; i < n; ++i) {
for (size_t i = 0, n = get_entity_n_overwrittenby(ent); i < n; ++i) {
if (get_entity_overwrittenby(ent, i) == overwrites)
return i;
}
......@@ -831,9 +813,7 @@ void set_entity_overwrittenby(ir_entity *ent, size_t pos, ir_entity *overwrites)
void remove_entity_overwrittenby(ir_entity *ent, ir_entity *overwrites)
{
size_t i;
size_t n = get_entity_n_overwrittenby(ent);
for (i = 0; i < n; ++i) {
for (size_t i = 0, n = get_entity_n_overwrittenby(ent); i < n; ++i) {
if (ent->overwrittenby[i] == overwrites) {
for (; i < n - 1; ++i)
ent->overwrittenby[i] = ent->overwrittenby[i+1];
......@@ -905,7 +885,7 @@ int (is_entity)(const void *thing)
int is_atomic_entity(const ir_entity *ent)
{
ir_type *t = get_entity_type(ent);
ir_type *t = get_entity_type(ent);
const tp_op *op = get_type_tpop(t);
return (op == type_primitive || op == type_pointer ||
op == type_enumeration || op == type_method);
......
......@@ -27,8 +27,8 @@ const tp_op *tpop_code; const tp_op *get_tpop_code_type (void) { retur
const tp_op *tpop_none; const tp_op *get_tpop_none (void) { return tpop_none; }
const tp_op *tpop_unknown; const tp_op *get_tpop_unknown (void) { return tpop_unknown; }
const tp_op *
new_tpop(tp_opcode code, ident *name, unsigned flags, size_t attr_size, const tp_op_ops *ops)
const tp_op *new_tpop(tp_opcode code, ident *name, unsigned flags,
size_t attr_size, const tp_op_ops *ops)
{
tp_op *res = XMALLOC(tp_op);
res->code = code;
......@@ -148,7 +148,8 @@ static const tp_op_ops
NULL,
NULL,
NULL
};
}
;
void init_tpop(void)
{
......
......@@ -32,34 +32,27 @@ ident *default_mangle_inherited_name(const ir_entity *super, const ir_type *clss
by an entity of this class. */
static void copy_entities_from_superclass(ir_type *clss, void *env)
{
size_t i;
size_t j;
size_t k;
size_t l;
int overwritten;
ir_type *super;
ir_entity *inhent, *thisent;
mangle_inherited_name_func *mfunc = *(mangle_inherited_name_func **)env;
for (i = 0; i < get_class_n_supertypes(clss); i++) {
super = get_class_supertype(clss, i);
for (j = 0; j < get_class_n_members(super); j++) {
inhent = get_class_member(super, j);
for (size_t i = 0; i < get_class_n_supertypes(clss); i++) {
ir_type *super = get_class_supertype(clss, i);
for (size_t j = 0; j < get_class_n_members(super); j++) {
ir_entity *inhent = get_class_member(super, j);
/* check whether inhent is already overwritten */
overwritten = 0;
for (k = 0; (k < get_class_n_members(clss)) && (overwritten == 0); k++) {
thisent = get_class_member(clss, k);
for (l = 0; l < get_entity_n_overwrites(thisent); l++) {
bool overwritten = false;
for (size_t k = 0; (k < get_class_n_members(clss)) && (overwritten == 0); k++) {
ir_entity *thisent = get_class_member(clss, k);
for (size_t l = 0; l < get_entity_n_overwrites(thisent); l++) {
if (inhent == get_entity_overwrites(thisent, l)) {
/* overwritten - do not copy */
overwritten = 1;
overwritten = true;
break;
}
}
}
/* Inherit entity */
if (!overwritten) {
thisent = copy_entity_own(inhent, clss);
ir_entity *thisent = copy_entity_own(inhent, clss);
add_entity_overwrites(thisent, inhent);
if (get_entity_peculiarity(inhent) == peculiarity_existent)
set_entity_peculiarity(thisent, peculiarity_inherited);
......@@ -96,11 +89,11 @@ void resolve_inheritance(mangle_inherited_name_func *mfunc)
/* adding the infix 'trans_'. */
/* ----------------------------------------------------------------------- */
void set_irp_inh_transitive_closure_state(inh_transitive_closure_state s)
void set_irp_inh_transitive_closure_state(inh_transitive_closure_state s)
{
irp->inh_trans_closure_state = s;
}
void invalidate_irp_inh_transitive_closure_state(void)
void invalidate_irp_inh_transitive_closure_state(void)
{
if (irp->inh_trans_closure_state == inh_transitive_closure_valid)
irp->inh_trans_closure_state = inh_transitive_closure_invalid;
......@@ -131,7 +124,7 @@ typedef enum {
typedef struct {
const firm_kind *kind; /**< An entity or type. */
pset *directions[2];
pset *directions[2];
} tr_inh_trans_tp;
/* We use this set for all types and entities. */
......@@ -142,10 +135,9 @@ static set *tr_inh_trans_set = NULL;
*/
static int tr_inh_trans_cmp(const void *e1, const void *e2, size_t size)
{
(void) size;
const tr_inh_trans_tp *ef1 = (const tr_inh_trans_tp*)e1;
const tr_inh_trans_tp *ef2 = (const tr_inh_trans_tp*)e2;
(void) size;
return ef1->kind != ef2->kind;
}
......@@ -160,12 +152,12 @@ static inline unsigned int tr_inh_trans_hash(const tr_inh_trans_tp *v)
/* This always completes successfully. */
static tr_inh_trans_tp *get_firm_kind_entry(const firm_kind *k)
{
tr_inh_trans_tp a, *found;
a.kind = k;
if (!tr_inh_trans_set) tr_inh_trans_set = new_set(tr_inh_trans_cmp, 128);
if (tr_inh_trans_set == NULL)
tr_inh_trans_set = new_set(tr_inh_trans_cmp, 128);
found = set_find(tr_inh_trans_tp, tr_inh_trans_set, &a, sizeof(a), tr_inh_trans_hash(&a));
tr_inh_trans_tp a;
a.kind = k;
tr_inh_trans_tp *found = set_find(tr_inh_trans_tp, tr_inh_trans_set, &a, sizeof(a), tr_inh_trans_hash(&a));
if (!found) {
a.directions[d_up] = pset_new_ptr(16);
a.directions[d_down] = pset_new_ptr(16);
......@@ -176,19 +168,15 @@ static tr_inh_trans_tp *get_firm_kind_entry(const firm_kind *k)
static pset *get_entity_map(const ir_entity *ent, dir d)
{
tr_inh_trans_tp *found;
assert(is_entity(ent));
found = get_firm_kind_entry((const firm_kind *)ent);
tr_inh_trans_tp *found = get_firm_kind_entry((const firm_kind *)ent);
return found->directions[d];
}
static pset *get_type_map(const ir_type *tp, dir d)
{
tr_inh_trans_tp *found;
assert(is_type(tp));
found = get_firm_kind_entry((const firm_kind *)tp);
tr_inh_trans_tp *found = get_firm_kind_entry((const firm_kind *)tp);
return found->directions[d];
}
......@@ -211,15 +199,12 @@ static pset *get_type_map(const ir_type *tp, dir d)
* Well, we still miss some candidates ... */
static void compute_down_closure(ir_type *tp)
{
pset *myset, *subset;
size_t i, n_subtypes, n_members, n_supertypes;
ir_visited_t master_visited = get_master_type_visited();
set_type_visited(tp, master_visited-1);
/* Recursive descend. */
n_subtypes = get_class_n_subtypes(tp);
for (i = 0; i < n_subtypes; ++i) {
size_t n_subtypes = get_class_n_subtypes(tp);
for (size_t i = 0; i < n_subtypes; ++i) {
ir_type *stp = get_class_subtype(tp, i);
if (get_type_visited(stp) < master_visited-1) {
compute_down_closure(stp);
......@@ -227,24 +212,23 @@ static void compute_down_closure(ir_type *tp)
}
/* types */
myset = get_type_map(tp, d_down);
for (i = 0; i < n_subtypes; ++i) {
ir_type *stp = get_class_subtype(tp, i);
subset = get_type_map(stp, d_down);
pset *myset = get_type_map(tp, d_down);
for (size_t i = 0; i < n_subtypes; ++i) {
ir_type *stp = get_class_subtype(tp, i);
pset *subset = get_type_map(stp, d_down);
pset_insert_ptr(myset, stp);
pset_insert_pset_ptr(myset, subset);
}
/* entities */
n_members = get_class_n_members(tp);
for (i = 0; i < n_members; ++i) {
for (size_t i = 0, n_members = get_class_n_members(tp); i < n_members; ++i) {
ir_entity *mem = get_class_member(tp, i);
size_t j, n_overwrittenby = get_entity_n_overwrittenby(mem);
myset = get_entity_map(mem, d_down);
for (j = 0; j < n_overwrittenby; ++j) {
ir_entity *ov = get_entity_overwrittenby(mem, j);
subset = get_entity_map(ov, d_down);
ir_entity *ov = get_entity_overwrittenby(mem, j);
pset *subset = get_entity_map(ov, d_down);
pset_insert_ptr(myset, ov);
pset_insert_pset_ptr(myset, subset);
}
......@@ -253,8 +237,8 @@ static void compute_down_closure(ir_type *tp)
mark_type_visited(tp);
/* Walk up. */
n_supertypes = get_class_n_supertypes(tp);
for (i = 0; i < n_supertypes; ++i) {
for (size_t i = 0, n_supertypes = get_class_n_supertypes(tp);
i < n_supertypes; ++i) {
ir_type *stp = get_class_supertype(tp, i);
if (get_type_visited(stp) < master_visited-1) {
compute_down_closure(stp);
......@@ -264,15 +248,12 @@ static void compute_down_closure(ir_type *tp)
static void compute_up_closure(ir_type *tp)
{
pset *myset, *subset;
size_t i, n_subtypes, n_members, n_supertypes;
ir_visited_t master_visited = get_master_type_visited();
set_type_visited(tp, master_visited-1);
/* Recursive descend. */
n_supertypes = get_class_n_supertypes(tp);
for (i = 0; i < n_supertypes; ++i) {
size_t n_supertypes = get_class_n_supertypes(tp);
for (size_t i = 0; i < n_supertypes; ++i) {
ir_type *stp = get_class_supertype(tp, i);
if (get_type_visited(stp) < get_master_type_visited()-1) {
compute_up_closure(stp);
......@@ -280,24 +261,22 @@ static void compute_up_closure(ir_type *tp)
}
/* types */
myset = get_type_map(tp, d_up);
for (i = 0; i < n_supertypes; ++i) {
ir_type *stp = get_class_supertype(tp, i);
subset = get_type_map(stp, d_up);
pset *myset = get_type_map(tp, d_up);
for (size_t i = 0; i < n_supertypes; ++i) {
ir_type *stp = get_class_supertype(tp, i);
pset *subset = get_type_map(stp, d_up);
pset_insert_ptr(myset, stp);
pset_insert_pset_ptr(myset, subset);
}
/* entities */
n_members = get_class_n_members(tp);
for (i = 0; i < n_members; ++i) {
ir_entity *mem = get_class_member(tp, i);
size_t j, n_overwrites = get_entity_n_overwrites(mem);
myset = get_entity_map(mem, d_up);
for (j = 0; j < n_overwrites; ++j) {
ir_entity *ov = get_entity_overwrites(mem, j);
subset = get_entity_map(ov, d_up);
for (size_t i = 0, n_members = get_class_n_members(tp); i < n_members; ++i) {
ir_entity *mem = get_class_member(tp, i);
pset *myset = get_entity_map(mem, d_up);
for (size_t j = 0, n_overwrites = get_entity_n_overwrites(mem);
j < n_overwrites; ++j) {
ir_entity *ov = get_entity_overwrites(mem, j);
pset *subset = get_entity_map(ov, d_up);
pset_insert_pset_ptr(myset, subset);
pset_insert_ptr(myset, ov);
}
......@@ -306,8 +285,8 @@ static void compute_up_closure(ir_type *tp)
mark_type_visited(tp);
/* Walk down. */
n_subtypes = get_class_n_subtypes(tp);
for (i = 0; i < n_subtypes; ++i) {
for (size_t i = 0, n_subtypes = get_class_n_subtypes(tp);
i < n_subtypes; ++i) {
ir_type *stp = get_class_subtype(tp, i);
if (get_type_visited(stp) < master_visited-1) {
compute_up_closure(stp);
......@@ -317,21 +296,21 @@ static void compute_up_closure(ir_type *tp)
void compute_inh_transitive_closure(void)
{
size_t i, n_types = get_irp_n_types();
free_inh_transitive_closure();
/* The 'down' relation */
irp_reserve_resources(irp, IRP_RESOURCE_TYPE_VISITED);
inc_master_type_visited(); /* Inc twice: one if on stack, second if values computed. */
inc_master_type_visited();
for (i = 0; i < n_types; ++i) {
size_t n_types = get_irp_n_types();
for (size_t i = 0; i < n_types; ++i) {
ir_type *tp = get_irp_type(i);
if (is_Class_type(tp) && type_not_visited(tp)) { /* For others there is nothing to accumulate. */
size_t j, n_subtypes = get_class_n_subtypes(tp);
size_t n_subtypes = get_class_n_subtypes(tp);
int has_unmarked_subtype = 0;
assert(get_type_visited(tp) < get_master_type_visited()-1);
for (j = 0; j < n_subtypes; ++j) {
for (size_t j = 0; j < n_subtypes; ++j) {
ir_type *stp = get_class_subtype(tp, j);
if (type_not_visited(stp)) {
has_unmarked_subtype = 1;
......@@ -348,14 +327,14 @@ void compute_inh_transitive_closure(void)
/* The 'up' relation */
inc_master_type_visited();
inc_master_type_visited();
for (i = 0; i < n_types; ++i) {
for (size_t i = 0; i < n_types; ++i) {
ir_type *tp = get_irp_type(i);
if (is_Class_type(tp) && type_not_visited(tp)) { /* For others there is nothing to accumulate. */
size_t j, n_supertypes = get_class_n_supertypes(tp);
size_t n_supertypes = get_class_n_supertypes(tp);
int has_unmarked_supertype = 0;
assert(get_type_visited(tp) < get_master_type_visited()-1);
for (j = 0; j < n_supertypes; ++j) {
for (size_t j = 0; j < n_supertypes; ++j) {
ir_type *stp = get_class_supertype(tp, j);
if (type_not_visited(stp)) {
has_unmarked_supertype = 1;
......@@ -457,11 +436,9 @@ ir_entity *get_entity_trans_overwrites_next(const ir_entity *ent)
/** Returns true if low is subclass of high. */
static int check_is_SubClass_of(ir_type *low, ir_type *high)
{
size_t i, n_subtypes;
/* depth first search from high downwards. */
n_subtypes = get_class_n_subtypes(high);
for (i = 0; i < n_subtypes; i++) {
for (size_t i = 0, n_subtypes = get_class_n_subtypes(high);
i < n_subtypes; i++) {
ir_type *stp = get_class_subtype(high, i);
if (low == stp) return 1;
if (is_SubClass_of(low, stp))
......@@ -473,8 +450,8 @@ static int check_is_SubClass_of(ir_type *low, ir_type *high)
int is_SubClass_of(ir_type *low, ir_type *high)
{
assert(is_Class_type(low) && is_Class_type(high));
if (low == high) return 1;
if (low == high)
return 1;
if (get_irp_inh_transitive_closure_state() == inh_transitive_closure_valid) {
pset *m = get_type_map(high, d_down);
......@@ -497,17 +474,15 @@ int is_SubClass_ptr_of(ir_type *low, ir_type *high)
int is_overwritten_by(ir_entity *high, ir_entity *low)
{
size_t i, n_overwrittenby;
assert(is_entity(low) && is_entity(high));
if (get_irp_inh_transitive_closure_state() == inh_transitive_closure_valid) {
pset *m = get_entity_map(high, d_down);
return pset_find_ptr(m, low) ? 1 : 0;
}
/* depth first search from high downwards. */
n_overwrittenby = get_entity_n_overwrittenby(high);
for (i = 0; i < n_overwrittenby; i++) {
for (size_t i = 0, n_overwrittenby = get_entity_n_overwrittenby(high);
i < n_overwrittenby; i++) {
ir_entity *ov = get_entity_overwrittenby(high, i);
if (low == ov) return 1;
if (is_overwritten_by(low, ov))
......@@ -526,17 +501,17 @@ int is_overwritten_by(ir_entity *high, ir_entity *low)
*/
static ir_entity *do_resolve_ent_polymorphy(ir_type *dynamic_class, ir_entity *static_ent)
{
size_t i, n_overwrittenby;
ir_type *owner = get_entity_owner(static_ent);
if (owner == dynamic_class) return static_ent;
if (owner == dynamic_class)
return static_ent;
// if the owner of the static_ent already is more special than the dynamic
// type to check against - stop here.
if (! is_SubClass_of(dynamic_class, owner)) return NULL;
if (!is_SubClass_of(dynamic_class, owner))
return NULL;
n_overwrittenby = get_entity_n_overwrittenby(static_ent);
for (i = 0; i < n_overwrittenby; ++i) {
for (size_t i = 0, n_overwrittenby = get_entity_n_overwrittenby(static_ent);
i < n_overwrittenby; ++i) {
ir_entity *ent = get_entity_overwrittenby(static_ent, i);
ent = do_resolve_ent_polymorphy(dynamic_class, ent);
if (ent) return ent;
......@@ -548,11 +523,8 @@ static ir_entity *do_resolve_ent_polymorphy(ir_type *dynamic_class, ir_entity *s
ir_entity *resolve_ent_polymorphy(ir_type *dynamic_class, ir_entity *static_ent)
{
ir_entity *res;
assert(static_ent && is_entity(static_ent));
res = do_resolve_ent_polymorphy(dynamic_class, static_ent);