+static void dump_block(ir_node *bl, void *data)
+{
+ const env_t *env = data;
+ FILE *f = env->data;
+ char buf[128];
+
+ draw_interval_graph(env, bl, &dump_params);
+
+ intv_filename(buf, sizeof(buf), env, bl);
+ ir_fprintf(f, "\tb%N [shape=\"epsf\" shapefile=\"%s\"];\n", bl, buf);
+}
+
+static void dump_edges(ir_node *bl, void *data)
+{
+ const env_t *env = data;
+ FILE *f = env->data;
+ int i, n;
+ ir_node *dom;
+
+#if 0
+ for(i = 0, n = get_irn_arity(bl); i < n; ++i) {
+ ir_node *pred = get_irn_n(bl, i);
+ ir_fprintf(f, "\tb%N -> b%N;\n", get_nodes_block(pred), bl);
+ }
+#endif
+
+ for(dom = get_Block_dominated_first(bl); dom;
+ dom = get_Block_dominated_next(dom)) {
+
+ ir_fprintf(f, "\tb%N -> b%N;\n", dom, bl);
+ }
+}
+
+static void dump_intv_cfg(env_t *env)
+{
+ FILE *f;
+ char buf[128];
+
+ ir_snprintf(buf, sizeof(buf), "intv_cfg_%s_%F.dot",
+ env->cls->name, env->irg);
+
+ if((f = fopen(buf, "wt")) != NULL) {
+ void *old_data = env->data;
+
+ env->data = f;
+ ir_fprintf(f, "digraph G {\n");
+ ir_fprintf(f, "\tgraph [rankdir=\"LR\", ordering=\"out\"];\n");
+ dom_tree_walk_irg(env->irg, dump_block, dump_edges, env);
+ // irg_block_walk_graph(env->irg, dump_block, dump_edges, env);
+ ir_fprintf(f, "}\n");
+ fclose(f);
+
+ env->data = old_data;
+ }
+}
+
+#endif
+
+#ifdef BUILD_GRAPH
+
+#define IF_EDGE_HASH(e) ((e)->src)
+#define IF_NODE_HASH(n) ((n)->nnr)
+
+static int if_edge_cmp(const void *p1, const void *p2, size_t size)
+{
+ const if_edge_t *e1 = p1;
+ const if_edge_t *e2 = p2;
+
+ return !(e1->src == e2->src && e1->tgt == e2->tgt);
+}
+
+static int if_node_cmp(const void *p1, const void *p2, size_t size)
+{
+ const if_node_t *n1 = p1;
+ const if_node_t *n2 = p2;
+
+ return n1->nnr != n2->nnr;
+}
+