8
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Apr 1998 21:42:19 +0000 (21:42 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Apr 1998 21:42:19 +0000 (21:42 +0000)
        * flow.c (dump_sbitmap, dump_sbitmap_vector): New debugging
        functions.
        * basic-block.h: Declare them.

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

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

index 01a682e..048cbde 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 5794070..8e4da8c 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