X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firdump.c;h=ffcba0c490a9e1a59555eab135da7b693d0d4243;hb=671ced672859c875de7c1d9c4a4750a29514446f;hp=538badc5421ac75e0ddf9fa72338eb00e9d1144a;hpb=f352642539bd3f1e4cb15b07cb52c7eb25582220;p=libfirm diff --git a/ir/ir/irdump.c b/ir/ir/irdump.c index 538badc54..ffcba0c49 100644 --- a/ir/ir/irdump.c +++ b/ir/ir/irdump.c @@ -88,6 +88,8 @@ static int dump_backedge_information_flag = 1; static int dump_const_local = 1; /** An option to dump the node index number. */ static int dump_node_idx_labels = 0; +/** An option to dump the node number */ +static int dump_node_nr = 0; /** An option to dump all graph anchors */ static int dump_anchors = 0; /** An option to dump the macro block edges. */ @@ -804,12 +806,14 @@ int dump_node_opcode(FILE *F, ir_node *n) } break; +#ifdef INTERPROCEDURAL_VIEW case iro_Filter: if (!get_interprocedural_view()) fprintf(F, "Proj'"); else goto default_case; break; +#endif case iro_Proj: { ir_node *pred = get_Proj_pred(n); @@ -821,6 +825,8 @@ int dump_node_opcode(FILE *F, ir_node *n) else goto default_case; } break; + +#ifdef INTERPROCEDURAL_VIEW case iro_Start: case iro_End: case iro_EndExcept: @@ -830,6 +836,7 @@ int dump_node_opcode(FILE *F, ir_node *n) break; } else goto default_case; +#endif case iro_CallBegin: { ir_node *addr = get_CallBegin_ptr(n); @@ -853,8 +860,13 @@ int dump_node_opcode(FILE *F, ir_node *n) fprintf(F, "%s", get_irn_opname(n)); break; case iro_Block: - fprintf(F, "%s%s%s", - is_Block_dead(n) ? "Dead " : "", get_irn_opname(n), + if (is_Block_dead(n)) + fputs("Dead ", F); + if (n == get_irg_start_block(get_irn_irg(n))) + fputs("Start ", F); + if (n == get_irg_end_block(get_irn_irg(n))) + fputs("End ", F); + fprintf(F, "%s%s", get_irn_opname(n), dump_block_marker ? (get_Block_mark(n) ? "*" : "") : ""); break; case iro_Conv: @@ -1129,12 +1141,6 @@ static int dump_node_nodeattr(FILE *F, ir_node *n) return ops->dump_node(n, F, dump_node_nodeattr_txt); switch (get_irn_opcode(n)) { - case iro_Start: - if (0 && get_interprocedural_view()) { - fprintf(F, "%s ", get_ent_dump_name(get_irg_entity(current_ir_graph))); - } - break; - case iro_Const: ir_fprintf(F, "%T ", get_Const_tarval(n)); break; @@ -1142,7 +1148,9 @@ static int dump_node_nodeattr(FILE *F, ir_node *n) case iro_Proj: pred = get_Proj_pred(n); proj_nr = get_Proj_proj(n); +#ifdef INTERPROCEDURAL_VIEW handle_lut: +#endif code = get_irn_opcode(pred); if (code == iro_Cmp) @@ -1178,11 +1186,13 @@ handle_lut: break; case iro_Filter: proj_nr = get_Filter_proj(n); +#ifdef INTERPROCEDURAL_VIEW if (! get_interprocedural_view()) { /* it's a Proj' */ pred = get_Filter_pred(n); goto handle_lut; } else +#endif fprintf(F, "%ld ", proj_nr); break; case iro_Sel: @@ -1235,11 +1245,12 @@ int dump_node_label(FILE *F, ir_node *n) fprintf(F, " "); bad |= dump_node_typeinfo(F, n); bad |= dump_node_nodeattr(F, n); - if (dump_node_idx_labels) { - fprintf(F, "%ld:%d", get_irn_node_nr(n), get_irn_idx(n)); - } else { + if (dump_node_nr) { fprintf(F, "%ld", get_irn_node_nr(n)); } + if (dump_node_idx_labels) { + fprintf(F, ":%u", get_irn_idx(n)); + } return bad; } @@ -1252,7 +1263,7 @@ int dump_vrp_info(FILE *F, ir_node *n) return 1; } - fprintf(F, "range_type: %d\n", vrp->range_type); + fprintf(F, "range_type: %d\n", (int) vrp->range_type); if (vrp->range_type == VRP_RANGE || vrp->range_type == VRP_ANTIRANGE) { ir_fprintf(F, "range_bottom: %F\n",vrp->range_bottom); @@ -1337,8 +1348,6 @@ static void dump_node_vcgattr(FILE *F, ir_node *node, ir_node *local, int bad) print_vcg_color(F, ird_color_uses_memory); } else if (is_op_cfopcode(op) || is_op_forking(op)) { print_vcg_color(F, ird_color_controlflow); - } else { - PRINT_DEFAULT_NODE_ATTR; } } } @@ -1638,7 +1647,6 @@ static void print_edge_vcgattr(FILE *F, ir_node *from, int to) static void dump_ir_data_edges(FILE *F, ir_node *n) { int i, num; - ir_visited_t visited = get_irn_visited(n); if (!dump_keepalive && is_End(n)) { /* the End node has only keep-alive edges */ @@ -1672,8 +1680,10 @@ static void dump_ir_data_edges(FILE *F, ir_node *n) ir_node *pred = get_irn_n(n, i); assert(pred); - if ((get_interprocedural_view() && get_irn_visited(pred) < visited)) +#ifdef INTERPROCEDURAL_VIEW + if ((get_interprocedural_view() && get_irn_visited(pred) < get_irn_visited(n))) continue; /* pred not dumped */ +#endif if (dump_backedge_information_flag && is_backedge(n, i)) fprintf(F, "backedge: {sourcename: \""); @@ -2063,12 +2073,11 @@ int dump_type_node(FILE *F, ir_type *tp) } -void dump_entity_node(FILE *F, ir_entity *ent) +static void dump_entity_node(FILE *F, ir_entity *ent) { fprintf(F, "node: {title: \""); PRINT_ENTID(ent); fprintf(F, "\""); - fprintf(F, DEFAULT_TYPE_ATTRIBUTE); - fprintf(F, "label: "); + fprintf(F, " label: "); fprintf(F, "\"%s\" ", get_ent_dump_name(ent)); print_vcg_color(F, ird_color_entity); @@ -2094,8 +2103,7 @@ static void dump_enum_item(FILE *F, ir_type *tp, int pos) strncpy(buf, "", sizeof(buf)); fprintf(F, "node: {title: \""); PRINT_ITEMID(tp, pos); fprintf(F, "\""); - fprintf(F, DEFAULT_ENUM_ITEM_ATTRIBUTE); - fprintf(F, "label: "); + fprintf(F, " label: "); fprintf(F, "\"enum item %s\" " ENUM_ITEM_NODE_ATTR, get_id_str(id)); fprintf(F, "\n info1: \"value: %s\"}\n", buf); } @@ -2553,9 +2561,12 @@ static void do_dump(ir_graph *irg, const char *suffix, const char *suffix_ip, rem = current_ir_graph; current_ir_graph = irg; + (void) suffix_ip; +#ifdef INTERPROCEDURAL_VIEW if (get_interprocedural_view()) suffix1 = suffix_ip; else +#endif suffix1 = suffix_nonip; current_ir_graph = rem; @@ -3099,7 +3110,7 @@ ir_prog_pass_t *dump_all_ir_graph_pass(const char *name, * packed together in one subgraph/box * *--------------------------------------------------------------------------------*/ -void dump_loops_standalone(FILE *F, ir_loop *loop) +static void dump_loops_standalone(FILE *F, ir_loop *loop) { int i = 0, loop_node_started = 0, son_number = 0, first = 0; loop_element le; @@ -3221,7 +3232,7 @@ void dump_callgraph_loop_tree(const char *suffix) /* Dumps the firm nodes in the loop tree to a graph along with the loop nodes.*/ /*----------------------------------------------------------------------------*/ -void collect_nodeloop(FILE *F, ir_loop *loop, eset *loopnodes) +static void collect_nodeloop(FILE *F, ir_loop *loop, eset *loopnodes) { int i, son_number = 0, node_number = 0; @@ -3240,7 +3251,8 @@ void collect_nodeloop(FILE *F, ir_loop *loop, eset *loopnodes) } } -void collect_nodeloop_external_nodes(ir_loop *loop, eset *loopnodes, eset *extnodes) +static void collect_nodeloop_external_nodes(ir_loop *loop, eset *loopnodes, + eset *extnodes) { int i, j, start;