Added C++ Krempel :-)
[libfirm] / ir / tr / trvrfy.c
index ad8b94d..30d3cea 100644 (file)
@@ -9,6 +9,9 @@
  * Copyright:   (c) 2003 Universität Karlsruhe
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "trvrfy.h"
 #include "irgraph_t.h"  /* for checking whether constant code is allocated
@@ -144,6 +147,15 @@ static int check_entity(entity *ent) {
     assert(0 && "Contants placed on wrong IRG");
     return error_const_on_wrong_irg;
   }
+
+  if ((get_entity_peculiarity(ent) == peculiarity_existent) &&
+      (get_entity_visibility(ent) != visibility_external_allocated) &&
+      (is_method_type(get_entity_type(ent)))                &&
+      (!get_entity_irg(ent) || !(is_ir_graph(get_entity_irg(ent))))) {
+    assert(0 && "Method ents with pec_exist must have an irg");
+    return error_existent_entity_without_irg;
+  }
+
   return 0;
 }