Commit dc27e8af authored by Michael Beck's avatar Michael Beck
Browse files

Improved 21ff67fb03f6a597f78ea76b77af206d8ad17e1a.

Make an if instead of a #if 0 on "broken" code and add an comment
that explains why the non-wroken code is not used now.
parent a4c4c422
...@@ -153,7 +153,7 @@ static void show_ent_overwrite_cnt(ir_entity *ent) ...@@ -153,7 +153,7 @@ static void show_ent_overwrite_cnt(ir_entity *ent)
*/ */
static int check_class(ir_type *tp) static int check_class(ir_type *tp)
{ {
size_t i, n, j, m; size_t i, n;
for (i = 0, n = get_class_n_members(tp); i < n; ++i) { for (i = 0, n = get_class_n_members(tp); i < n; ++i) {
ir_entity *mem = get_class_member(tp, i); ir_entity *mem = get_class_member(tp, i);
...@@ -178,27 +178,29 @@ static int check_class(ir_type *tp) ...@@ -178,27 +178,29 @@ static int check_class(ir_type *tp)
show_ent_overwrite_cnt(mem) show_ent_overwrite_cnt(mem)
); );
#if 0 if (false) {
for (j = 0, m = get_entity_n_overwrites(mem); j < m; ++j) { size_t j, m;
ir_entity *ovw = get_entity_overwrites(mem, j); /* check if the overwrite relation is flat, i.e. every overwrite
size_t k, n_super; * is visible in every direct superclass. */
for (j = 0, m = get_entity_n_overwrites(mem); j < m; ++j) {
/* Check whether ovw is member of one of tp's supertypes. If so, ir_entity *ovw = get_entity_overwrites(mem, j);
the representation is correct. */ size_t k, n_super;
for (k = 0, n_super = get_class_n_supertypes(tp); k < n_super; ++k) {
if (get_class_member_index(get_class_supertype(tp, k), ovw) != INVALID_MEMBER_INDEX) { /* Check whether ovw is member of one of tp's supertypes. If so,
ASSERT_AND_RET_DBG( the representation is correct. */
0, for (k = 0, n_super = get_class_n_supertypes(tp); k < n_super; ++k) {
"overwrites an entity not contained in direct supertype", if (get_class_member_index(get_class_supertype(tp, k), ovw) != INVALID_MEMBER_INDEX) {
error_ent_not_cont, ASSERT_AND_RET_DBG(
show_ent_not_supertp(mem, ovw) 0,
); "overwrites an entity not contained in direct supertype",
break; error_ent_not_cont,
show_ent_not_supertp(mem, ovw)
);
break;
}
} }
} }
} }
#endif
} }
return 0; return 0;
} }
......
Supports Markdown
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