check for correct use of pec_inherited
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Sat, 25 Sep 2004 11:13:38 +0000 (11:13 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Sat, 25 Sep 2004 11:13:38 +0000 (11:13 +0000)
[r3946]

ir/tr/trvrfy.c

index 2e04270..fd3d576 100644 (file)
@@ -169,6 +169,12 @@ static int check_entity(entity *ent) {
     return error_existent_entity_without_irg;
   }
 
+  if (get_entity_peculiarity(ent) == peculiarity_inherited) {
+    entity *impl = get_SymConst_entity(get_atomic_ent_value(ent));
+    assert(get_entity_peculiarity(impl) == peculiarity_existent &&
+          "inherited entities must have constant pointing to existent entity.");
+  }
+
   return 0;
 }