X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeutil.c;h=1637c4d2115408a5c59aa9f5db55959aff43aa2f;hb=c1fdf770d4d000dd5cf22daead32369342c5f5d1;hp=3ab4f9f28893ee9ee66ff2ffd9601b5899596e50;hpb=0fbcef83aa6060534172bb13e71cdadb04428806;p=libfirm diff --git a/ir/be/beutil.c b/ir/be/beutil.c index 3ab4f9f28..1637c4d21 100644 --- a/ir/be/beutil.c +++ b/ir/be/beutil.c @@ -56,64 +56,6 @@ pset *be_empty_set(void) return empty_set; } -static void dump_allocated_block(ir_node *block, void *data) -{ - FILE *f = data; - const ir_node *irn; - int n; - int i; - - 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(irn); - - ir_fprintf(f, "\n"); - if(reg) - ir_fprintf(f, "%s = ", arch_register_get_name(reg)); - - ir_fprintf(f, "%n(", irn); - - if(block != get_irg_start_block(get_irn_irg(block))) { - for(i = 0, n = get_irn_arity(irn); i < n; ++i) { - ir_node *op = get_irn_n(irn, i); - if (arch_is_register_operand(op, -1)) { - ir_fprintf(f, "%s%s", prefix, - arch_register_get_name(arch_get_irn_register(op))); - prefix = ", "; - } - } - } - - ir_fprintf(f, ")"); - } - 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", block, pred_bl); - } - } -} - -void dump_allocated_irg(ir_graph *irg, char *suffix) -{ - char buf[1024]; - FILE *f; - - ir_snprintf(buf, sizeof(buf), "%F-alloc%s.vcg", irg, suffix); - - f = fopen(buf, "wt"); - if (f != NULL) { - fprintf(f, "graph:{title:\"prg\"\n"); - irg_block_walk_graph(irg, dump_allocated_block, NULL, f); - fprintf(f, "}\n"); - fclose(f); - } -} - /** * Edge hook to dump the schedule edges. */ @@ -173,18 +115,6 @@ void be_dump(ir_graph *irg, const char *suffix, void (*dumper)(ir_graph *, const dumper(irg, buf); } - - -static void collect_phis(ir_node *irn, void *data) -{ - (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) { ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK); @@ -192,11 +122,6 @@ void be_clear_links(ir_graph *irg) ir_free_resources(irg, IR_RESOURCE_IRN_LINK); } -void be_collect_phis(ir_graph *irg) -{ - irg_walk_graph(irg, collect_phis, NULL, NULL); -} - static void count_num_reachable_nodes(ir_node *irn, void *env) { int *num = env;