* basic-block.h (struct edge_def): Add goto_locus.
* tree-cfg.c (make_goto_expr_edges): Set it.
(disband_implicit_edges): Use it.
* tree-pretty-print.c (dump_implicit_edges): Print it.
From-SVN: r82842
+2004-06-09 Richard Henderson <rth@redhat.com>
+
+ * basic-block.h (struct edge_def): Add goto_locus.
+ * tree-cfg.c (make_goto_expr_edges): Set it.
+ (disband_implicit_edges): Use it.
+ * tree-pretty-print.c (dump_implicit_edges): Print it.
+
2004-06-08 Anil Paranjpe <anilp1@kpitcummins.com>
* h8300.md (ldm_h8300s_4): Fix condition for expander.
/* Auxiliary info specific to a pass. */
PTR GTY ((skip (""))) aux;
+ /* Location of any goto implicit in the edge, during tree-ssa. */
+ location_t *goto_locus;
+
int flags; /* see EDGE_* below */
int probability; /* biased by REG_BR_PROB_BASE */
gcov_type count; /* Expected number of executions calculated
/* A GOTO to a local label creates normal edges. */
if (simple_goto_p (goto_t))
{
- make_edge (bb, label_to_block (dest), EDGE_FALLTHRU);
+ edge e = make_edge (bb, label_to_block (dest), EDGE_FALLTHRU);
+ e->goto_locus = EXPR_LOCUS (goto_t);
bsi_remove (&last);
return;
}
if (e->flags & EDGE_FALLTHRU)
break;
- if (!e
- || e->dest == bb->next_bb)
+ if (!e || e->dest == bb->next_bb)
continue;
if (e->dest == EXIT_BLOCK_PTR)
&& TREE_CODE (forward) == GOTO_EXPR)
label = GOTO_DESTINATION (forward);
- bsi_insert_after (&last,
- build1 (GOTO_EXPR, void_type_node, label),
- BSI_NEW_STMT);
+ stmt = build1 (GOTO_EXPR, void_type_node, label);
+ SET_EXPR_LOCUS (stmt, e->goto_locus);
+ bsi_insert_after (&last, stmt, BSI_NEW_STMT);
e->flags &= ~EDGE_FALLTHRU;
}
}
by INDENT spaces, with details given by FLAGS. */
static void
-dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent)
+dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent,
+ int flags)
{
edge e;
if (e && e->dest != bb->next_bb)
{
INDENT (indent);
+
+ if ((flags & TDF_LINENO) && e->goto_locus)
+ {
+ pp_character (buffer, '[');
+ if (e->goto_locus->file)
+ {
+ pp_string (buffer, e->goto_locus->file);
+ pp_string (buffer, " : ");
+ }
+ pp_decimal_int (buffer, e->goto_locus->line);
+ pp_string (buffer, "] ");
+ }
+
pp_cfg_jump (buffer, e->dest);
pp_newline (buffer);
}
pp_newline (buffer);
}
- dump_implicit_edges (buffer, bb, indent);
+ dump_implicit_edges (buffer, bb, indent, flags);
if (flags & TDF_BLOCKS)
dump_bb_end (buffer, bb, indent, flags);