flow.c (dump_sbitmap, [...]): New debugging functions.
authorJeff Law <law@gcc.gnu.org>
Thu, 16 Apr 1998 21:42:19 +0000 (15:42 -0600)
committerJeff Law <law@gcc.gnu.org>
Thu, 16 Apr 1998 21:42:19 +0000 (15:42 -0600)
8
        * flow.c (dump_sbitmap, dump_sbitmap_vector): New debugging
        functions.
        * basic-block.h: Declare them.

From-SVN: r19242

gcc/basic-block.h
gcc/flow.c

index 01a682e87fc4657af408bf5dba27f318dab9bc51..048cbde18d92dac928cd3982dd408aaa91e1e2e3 100644 (file)
@@ -190,6 +190,9 @@ extern int *uid_block_number;
 extern void compute_preds_succs PROTO ((int_list_ptr *, int_list_ptr *,
                                        int *, int *));
 extern void dump_bb_data       PROTO ((FILE *, int_list_ptr *, int_list_ptr *));
+extern void dump_sbitmap       PROTO ((FILE *, sbitmap));
+extern void dump_sbitmap_vector PROTO ((FILE *, char *, char *,
+                                       sbitmap *, int));
 extern void free_bb_mem        PROTO ((void));
 extern void free_basic_block_vars      PROTO ((int));
 
index 57940701ac8cd220ffe67b9b77210acf3c5bcc99..8e4da8ce1666d389157b1c822c2042d9468d7a9a 100644 (file)
@@ -3416,6 +3416,46 @@ dump_bb_data (file, preds, succs)
   fprintf (file, "\n");
 }
 
+void
+dump_sbitmap (file, bmap)
+     FILE *file;
+     sbitmap bmap;
+{
+  int i,j,n;
+  int set_size = bmap->size;
+  int total_bits = bmap->n_bits;
+
+  fprintf (file, "  ");
+  for (i = n = 0; i < set_size && n < total_bits; i++)
+    {
+      for (j = 0; j < SBITMAP_ELT_BITS && n < total_bits; j++, n++)
+       {
+         if (n != 0 && n % 10 == 0)
+           fprintf (file, " ");
+         fprintf (file, "%d", (bmap->elms[i] & (1L << j)) != 0);
+       }
+    }
+  fprintf (file, "\n");
+}
+
+void
+dump_sbitmap_vector (file, title, subtitle, bmaps, n_maps)
+     FILE *file;
+     char *title, *subtitle;
+     sbitmap *bmaps;
+     int n_maps;
+{
+  int bb;
+
+  fprintf (file, "%s\n", title);
+  for (bb = 0; bb < n_maps; bb++)
+    {
+      fprintf (file, "%s %d\n", subtitle, bb);
+      dump_sbitmap (file, bmaps[bb]);
+    }
+  fprintf (file, "\n");
+}
+
 /* Free basic block data storage.  */
 
 void