FILE *f = dump_env->f;
arch_env_t *env = dump_env->env;
- ir_fprintf(f, "node:{title:\"b%N\"\nlabel:\"%n\n", block, block);
+ ir_fprintf(f, "node:{title:\"b%N\"\nlabel:\"", block);
sched_foreach(block, irn) {
const char *prefix = "";
+
const arch_register_t *reg = arch_get_irn_register(env, irn, 0);
ir_fprintf(f, "\n");
if(get_irg_start_block(get_irn_irg(block)) != block) {
for(i = 0, n = get_irn_arity(block); i < n; ++i) {
ir_node *pred_bl = get_nodes_block(get_irn_n(block, i));
- ir_fprintf(f, "edge:{sourcename:\"b%N\" targetname:\"b%N\"}\n", pred_bl, block);
+ ir_fprintf(f, "edge:{sourcename:\"b%N\" targetname:\"b%N\"}\n", block, pred_bl);
}
}
}
dump_ir_block_graph(irg, suffix);
set_dump_node_edge_hook(old);
}
+
+static void clear_link(ir_node *irn, void *data)
+{
+ set_irn_link(irn, NULL);
+}
+
+static void collect_phis(ir_node *irn, void *data)
+{
+ if(is_Phi(irn)) {
+ ir_node *bl = get_nodes_block(irn);
+ set_irn_link(irn, get_irn_link(bl));
+ set_irn_link(bl, irn);
+ }
+}
+
+void be_clear_links(ir_graph *irg)
+{
+ irg_walk_graph(irg, clear_link, NULL, NULL);
+}
+
+void be_collect_phis(ir_graph *irg)
+{
+ irg_walk_graph(irg, collect_phis, NULL, NULL);
+}