renames access rouitne, SymConst support
[libfirm] / ir / tr / trvrfy.c
index 2e04270..6beedb7 100644 (file)
@@ -71,6 +71,17 @@ static int check_array(type *tp) {
   return 0;
 }
 
+
+/**
+ * Check a primitive.
+ */
+static int check_primitive(type *tp) {
+  assert(is_mode(get_type_mode(tp)));
+
+  return 0;
+}
+
+
 /**
  * Checks a type.
  *
@@ -82,6 +93,8 @@ static int check_type(type *tp) {
     return check_class(tp);
   case tpo_array:
     return check_array(tp);
+  case tpo_primitive:
+    return check_primitive(tp);
   default: break;
   }
   return 0;
@@ -169,6 +182,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;
 }