- for (j = get_entity_n_overwrites(mem) - 1; j >= 0; --j) {
- ir_entity *ovw = get_entity_overwrites(mem, j);
- /*printf(" overwrites: "); DDME(ovw);*/
- /* Check whether ovw is member of one of tp's supertypes. If so,
- the representation is correct. */
- found = 0;
- for (k = get_class_n_supertypes(tp) - 1; k >= 0; --k) {
- if (get_class_member_index(get_class_supertype(tp, k), ovw) >= 0) {
- found = 1;
- break;
+#if 0
+ {
+ size_t j, m;
+ /* check if the overwrite relation is flat, i.e. every overwrite
+ * is visible in every direct superclass. */
+ for (j = 0, m = get_entity_n_overwrites(mem); j < m; ++j) {
+ ir_entity *ovw = get_entity_overwrites(mem, j);
+ size_t k, n_super;
+
+ /* Check whether ovw is member of one of tp's supertypes. If so,
+ the representation is correct. */
+ 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) {
+ ASSERT_AND_RET_DBG(
+ 0,
+ "overwrites an entity not contained in direct supertype",
+ error_ent_not_cont,
+ show_ent_not_supertp(mem, ovw)
+ );
+ break;
+ }