prohibit inlining of pseudo ir_graphs
[libfirm] / ir / tr / trvrfy.c
index 30d3cea..fd3d576 100644 (file)
@@ -60,6 +60,17 @@ static int check_class(type *tp) {
   return 0;
 }
 
+/**
+ * Check an array.
+ */
+static int check_array(type *tp) {
+  int i, n_dim = get_array_n_dimensions(tp);
+  for (i = 0; i < n_dim; ++i)
+    assert(has_array_lower_bound(tp, i) || has_array_upper_bound(tp, i));
+
+  return 0;
+}
+
 /**
  * Checks a type.
  *
@@ -69,6 +80,8 @@ static int check_type(type *tp) {
   switch (get_type_tpop_code(tp)) {
   case tpo_class:
     return check_class(tp);
+  case tpo_array:
+    return check_array(tp);
   default: break;
   }
   return 0;
@@ -122,10 +135,10 @@ static int constants_on_wrong_irg(entity *ent) {
        return 1;
     }
   } else {
-    /* Might not be set if entity belongs to a description. */
+    /* Might not be set if entity belongs to a description or is external allocated. */
     if (get_atomic_ent_value(ent))
       return constant_on_wrong_irg(get_atomic_ent_value(ent));
-    else
+    else if (get_entity_visibility(ent) != visibility_external_allocated)
       assert((is_class_type(get_entity_owner(ent)) &&
              get_class_peculiarity(get_entity_owner(ent)) == peculiarity_description) &&
             "Value in constant atomic entity not set.");
@@ -156,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;
 }