OSDN Git Service

* basic-block.h (struct edge_def): Add goto_locus.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Jun 2004 17:00:30 +0000 (17:00 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Jun 2004 17:00:30 +0000 (17:00 +0000)
        * tree-cfg.c (make_goto_expr_edges): Set it.
        (disband_implicit_edges): Use it.
        * tree-pretty-print.c (dump_implicit_edges): Print it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82842 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/basic-block.h
gcc/tree-cfg.c
gcc/tree-pretty-print.c

index 4ec225d..09d1c8e 100644 (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.
index f087f8b..02ca281 100644 (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
index 65e8e89..d5ff919 100644 (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;
     }
 }
index ef130d8..d5566b8 100644 (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);