basic-block.h (struct edge_def): Add goto_locus.

* 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
This commit is contained in:
Richard Henderson 2004-06-09 10:00:30 -07:00 committed by Richard Henderson
parent 93a9f7d6c6
commit 62b857eabf
4 changed files with 32 additions and 8 deletions

View File

@ -1,3 +1,10 @@
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.

View File

@ -142,6 +142,9 @@ struct edge_def GTY((chain_next ("%h.pred_next")))
/* 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

View File

@ -680,7 +680,8 @@ make_goto_expr_edges (basic_block bb)
/* 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;
}
@ -2640,8 +2641,7 @@ disband_implicit_edges (void)
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)
@ -2658,9 +2658,9 @@ disband_implicit_edges (void)
&& 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;
}
}

View File

@ -2227,7 +2227,8 @@ pp_cfg_jump (pretty_printer *buffer, basic_block bb)
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;
@ -2239,6 +2240,19 @@ dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent)
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);
}
@ -2276,7 +2290,7 @@ dump_generic_bb_buff (pretty_printer *buffer, basic_block bb,
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);