12 static void dump_allocated_block(ir_node *block, void *env)
18 ir_fprintf(f, "node:{title:\"b%N\"\nlabel:\"%n\n", block, block);
19 sched_foreach(block, irn) {
20 const char *prefix = "";
23 if(is_color(get_irn_color(irn)))
24 ir_fprintf(f, "r%d = ", get_irn_color(irn));
25 ir_fprintf(f, "%n(", irn);
27 if(block != get_irg_start_block(get_irn_irg(block))) {
28 for(i = 0, n = get_irn_arity(irn); i < n; ++i) {
29 ir_node *op = get_irn_n(irn, i);
30 if(is_allocatable_irn(op)) {
31 ir_fprintf(f, "%sr%d", prefix, get_irn_color(op));
39 ir_fprintf(f, "\"}\n");
41 if(get_irg_start_block(get_irn_irg(block)) != block) {
42 for(i = 0, n = get_irn_arity(block); i < n; ++i) {
43 ir_node *pred_bl = get_nodes_block(get_irn_n(block, i));
44 ir_fprintf(f, "edge:{sourcename:\"b%N\" targetname:\"b%N\"}\n", pred_bl, block);
49 void dump_allocated_irg(ir_graph *irg)
54 snprintf(buf, sizeof(buf), "%s-alloc.vcg", get_entity_name(get_irg_entity(irg)));
56 if((f = fopen(buf, "wt")) != NULL) {
57 fprintf(f, "graph:{title:\"prg\"\n");
58 irg_block_walk_graph(irg, dump_allocated_block, NULL, f);