Remove unused variable.
[libfirm] / ir / tr / trvrfy.c
index ee3f615..301ea9a 100644 (file)
@@ -24,9 +24,7 @@
  * @author  Michael Beck, Goetz Lindenmaier
  * @version $Id$
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "irgraph_t.h"  /* for checking whether constant code is allocated
                            on proper obstack */
@@ -344,6 +342,7 @@ static int constants_on_wrong_irg(ir_entity *ent) {
  *  != 0    a trvrfy_error_codes code
  */
 int check_entity(ir_entity *ent) {
+       int rem_vpi;
        ir_type *tp = get_entity_type(ent);
        ir_type *owner = get_entity_owner(ent);
 
@@ -355,6 +354,21 @@ int check_entity(ir_entity *ent) {
                ir_fprintf(stderr, "%+e not on %+F\n", ent, current_ir_graph)
        );
 
+       rem_vpi = get_visit_pseudo_irgs();
+       set_visit_pseudo_irgs(1);
+       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_AND_RET_DBG(
+                       0,
+                       "Method ents with pec_exist must have an irg",
+                       error_existent_entity_without_irg,
+                       ir_fprintf(stderr, "%+e\n", ent)
+               );
+       }
+       set_visit_pseudo_irgs(rem_vpi);
+
        /* Originally, this test assumed, that only method entities have
           pecularity_inherited.  As I changed this, I have to test for method type before
           doing the test. */
@@ -401,14 +415,14 @@ int check_entity(ir_entity *ent) {
 /*
  * check types and entities
  */
-static void check_tore(type_or_ent *tore, void *env) {
+static void check_tore(type_or_ent tore, void *env) {
        int *res = env;
-       assert(tore);
-       if (is_type(tore)) {
-               *res = check_type((ir_type *)tore);
+       assert(tore.ent);
+       if (is_type(tore.typ)) {
+               *res = check_type(tore.typ);
        } else {
-               assert(is_entity(tore));
-               *res = check_entity((ir_entity *)tore);
+               assert(is_entity(tore.ent));
+               *res = check_entity(tore.ent);
        }
 }