/*
- * 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"
#include "irgwalk.h"
#include "irflag.h"
+DEBUG_ONLY(static firm_dbg_module_t *dbg);
/* ----------------------------------------------------------------------- */
/* Resolve implicit inheritance. */
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));
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));
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);
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)));
}
}