X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftr_inheritance.c;h=65433b03921bc7c6ef69f4a3b310e7d51c0674de;hb=dd4cd761ab637d4488c7e29f49843b1b02366acf;hp=0ed0c3702aab20e3149a88d73e07aabfdeee261d;hpb=78c9f9767f18b1b7a1b2a4d3856bafed029e46e5;p=libfirm diff --git a/ir/tr/tr_inheritance.c b/ir/tr/tr_inheritance.c index 0ed0c3702..65433b039 100644 --- a/ir/tr/tr_inheritance.c +++ b/ir/tr/tr_inheritance.c @@ -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. * @@ -27,6 +27,7 @@ # include "config.h" #endif +#include "debug.h" #include "typerep.h" #include "irgraph_t.h" #include "irprog_t.h" @@ -36,6 +37,7 @@ #include "irgwalk.h" #include "irflag.h" +DEBUG_ONLY(static firm_dbg_module_t *dbg); /* ----------------------------------------------------------------------- */ /* Resolve implicit inheritance. */ @@ -222,7 +224,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 +278,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 +621,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 +666,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))); } }