remove #ifdef HAVE_CONFIG_Hs
[libfirm] / ir / tr / tr_inheritance.c
index 0ed0c37..0b67580 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
  * @author  Goetz Lindenmaier
  * @version $Id$
  */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
+#include "debug.h"
 #include "typerep.h"
 #include "irgraph_t.h"
 #include "irprog_t.h"
@@ -36,6 +35,7 @@
 #include "irgwalk.h"
 #include "irflag.h"
 
+DEBUG_ONLY(static firm_dbg_module_t *dbg);
 
 /* ----------------------------------------------------------------------- */
 /* Resolve implicit inheritance.                                           */
@@ -222,7 +222,7 @@ static pset *get_type_map(const ir_type *tp, dir d) {
 static void compute_down_closure(ir_type *tp) {
        pset *myset, *subset;
        int i, n_subtypes, n_members, n_supertypes;
-       unsigned long master_visited = get_master_type_visited();
+       ir_visited_t master_visited = get_master_type_visited();
 
        assert(is_Class_type(tp));
 
@@ -276,7 +276,7 @@ static void compute_down_closure(ir_type *tp) {
 static void compute_up_closure(ir_type *tp) {
        pset *myset, *subset;
        int i, n_subtypes, n_members, n_supertypes;
-       unsigned long master_visited = get_master_type_visited();
+       ir_visited_t master_visited = get_master_type_visited();
 
        assert(is_Class_type(tp));
 
@@ -619,7 +619,7 @@ void verify_irn_class_cast_state(ir_node *n, void *env) {
        ir_type             *fromtype, *totype;
        int                 ref_depth = 0;
 
-       if (get_irn_op(n) != op_Cast) return;
+       if (!is_Cast(n)) return;
 
        fromtype = get_irn_typeinfo_type(get_Cast_op(n));
        totype   = get_Cast_type(n);
@@ -664,15 +664,18 @@ void verify_irn_class_cast_state(ir_node *n, void *env) {
 void verify_irg_class_cast_state(ir_graph *irg) {
        ccs_env env;
 
+       FIRM_DBG_REGISTER(dbg, "firm.tr.inheritance");
+
        env.expected_state  = get_irg_class_cast_state(irg);
        env.worst_situation = ir_class_casts_normalized;
 
        irg_walk_graph(irg, NULL, verify_irn_class_cast_state, &env);
 
-       if ((env.worst_situation > env.expected_state) && get_firm_verbosity()) {
-               ir_printf("Note:  class cast state is set lower than reqired in graph \n\t%+F\n", irg);
-               printf("       state is %s, reqired is %s\n",
+       if ((env.worst_situation > env.expected_state)) {
+               DB((dbg, LEVEL_1, "Note:  class cast state is set lower than reqired "
+                   "in graph \n\t%+F\n", irg));
+               DB((dbg, LEVEL_1, "       state is %s, reqired is %s\n",
                        get_class_cast_state_string(env.expected_state),
-                       get_class_cast_state_string(env.worst_situation));
+                       get_class_cast_state_string(env.worst_situation)));
        }
 }