OSDN Git Service

* basic-block.h (last_basic_block): Declare.
[pf3gnuchains/gcc-fork.git] / gcc / cfg.c
index d6c9f0d..313516b 100644 (file)
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -65,6 +65,10 @@ static char *flow_firstobj;
 
 int n_basic_blocks;
 
+/* First free basic block number.  */
+
+int last_basic_block;
+
 /* Number of edges in the current function.  */
 
 int n_edges;
@@ -243,14 +247,37 @@ unlink_block (b)
   b->prev_bb->next_bb = b->next_bb;
 }
 
+/* Sequentially order blocks and compact the arrays.  */
+void
+compact_blocks ()
+{
+  int i;
+  basic_block bb;
+  i = 0;
+  FOR_EACH_BB (bb)
+    {
+      BASIC_BLOCK (i) = bb;
+      bb->index = i;
+      i++;
+    }
+
+  if (i != n_basic_blocks)
+    abort ();
+
+  last_basic_block = n_basic_blocks;
+}
+
 
-/* Remove block B from the basic block array and compact behind it.  */
+/* Remove block B from the basic block array.  */
 
 void
-expunge_block_nocompact (b)
+expunge_block (b)
      basic_block b;
 {
   unlink_block (b);
+  BASIC_BLOCK (b->index) = NULL;
+  n_basic_blocks--;
 
   /* Invalidate data to make bughunting easier.  */
   memset (b, 0, sizeof *b);
@@ -258,25 +285,6 @@ expunge_block_nocompact (b)
   b->succ = (edge) first_deleted_block;
   first_deleted_block = (basic_block) b;
 }
-
-void
-expunge_block (b)
-     basic_block b;
-{
-  int i, n = n_basic_blocks;
-
-  for (i = b->index; i + 1 < n; ++i)
-    {
-      basic_block x = BASIC_BLOCK (i + 1);
-      BASIC_BLOCK (i) = x;
-      x->index = i;
-    }
-
-  n_basic_blocks--;
-  basic_block_info->num_elements--;
-
-  expunge_block_nocompact (b);
-}
 \f
 /* Create an edge connecting SRC and DST with FLAGS optionally using
    edge cache CACHE.  Return the new edge, NULL if already exist.  */
@@ -555,7 +563,7 @@ dump_flow_info (file)
        fprintf (file, ", maybe hot");
       if (probably_never_executed_bb_p (bb))
        fprintf (file, ", probably never executed");
-      fprintf (file, ".\n", bb->frequency);
+      fprintf (file, ".\n");
 
       fprintf (file, "Predecessors: ");
       for (e = bb->pred; e; e = e->pred_next)