OSDN Git Service

* bitmap.c (bitmap_release_memory): Move adjacent to the
[pf3gnuchains/gcc-fork.git] / gcc / bitmap.c
1 /* Functions to support general ended bitmaps.
2    Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 #include "config.h"
22 #include "system.h"
23 #include "rtl.h"
24 #include "flags.h"
25 #include "obstack.h"
26 #include "bitmap.h"
27
28 /* Obstack to allocate bitmap elements from.  */
29 static struct obstack bitmap_obstack;
30 static int bitmap_obstack_init = FALSE;
31 \f
32 #ifndef INLINE
33 #ifndef __GNUC__
34 #define INLINE
35 #else
36 #define INLINE __inline__
37 #endif
38 #endif
39
40 /* Global data */
41 bitmap_element bitmap_zero;             /* An element of all zero bits. */
42 bitmap_element *bitmap_free;            /* Freelist of bitmap elements. */
43
44 static void bitmap_element_free         PARAMS ((bitmap, bitmap_element *));
45 static bitmap_element *bitmap_element_allocate PARAMS ((void));
46 static int bitmap_element_zerop         PARAMS ((bitmap_element *));
47 static void bitmap_element_link         PARAMS ((bitmap, bitmap_element *));
48 static bitmap_element *bitmap_find_bit  PARAMS ((bitmap, unsigned int));
49 \f
50 /* Free a bitmap element */
51
52 static INLINE void
53 bitmap_element_free (head, elt)
54      bitmap head;
55      bitmap_element *elt;
56 {
57   bitmap_element *next = elt->next;
58   bitmap_element *prev = elt->prev;
59
60   if (prev)
61     prev->next = next;
62
63   if (next)
64     next->prev = prev;
65
66   if (head->first == elt)
67     head->first = next;
68
69   /* Since the first thing we try is to insert before current,
70      make current the next entry in preference to the previous.  */
71   if (head->current == elt)
72     head->current = next != 0 ? next : prev;
73
74   elt->next = bitmap_free;
75   bitmap_free = elt;
76 }
77 \f
78 /* Allocate a bitmap element.  The bits are cleared, but nothing else is.  */
79
80 static INLINE bitmap_element *
81 bitmap_element_allocate ()
82 {
83   bitmap_element *element;
84 #if BITMAP_ELEMENT_WORDS != 2
85   int i;
86 #endif
87
88   if (bitmap_free != 0)
89     {
90       element = bitmap_free;
91       bitmap_free = element->next;
92     }
93   else
94     {
95       /* We can't use gcc_obstack_init to initialize the obstack since
96          print-rtl.c now calls bitmap functions, and bitmap is linked
97          into the gen* functions.  */
98       if (!bitmap_obstack_init)
99         {
100           bitmap_obstack_init = TRUE;
101
102           /* Let particular systems override the size of a chunk.  */
103 #ifndef OBSTACK_CHUNK_SIZE
104 #define OBSTACK_CHUNK_SIZE 0
105 #endif
106           /* Let them override the alloc and free routines too.  */
107 #ifndef OBSTACK_CHUNK_ALLOC
108 #define OBSTACK_CHUNK_ALLOC xmalloc
109 #endif
110 #ifndef OBSTACK_CHUNK_FREE
111 #define OBSTACK_CHUNK_FREE free
112 #endif
113
114 #if !defined(__GNUC__) || (__GNUC__ < 2)
115 #define __alignof__(type) 0
116 #endif
117
118           obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
119                                       __alignof__ (bitmap_element),
120                                       (void *(*) PARAMS ((long))) OBSTACK_CHUNK_ALLOC,
121                                       (void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE);
122         }
123
124       element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
125                                                   sizeof (bitmap_element));
126     }
127
128 #if BITMAP_ELEMENT_WORDS == 2
129   element->bits[0] = element->bits[1] = 0;
130 #else
131   for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
132     element->bits[i] = 0;
133 #endif
134
135   return element;
136 }
137
138 /* Release any memory allocated by bitmaps.  */
139
140 void
141 bitmap_release_memory ()
142 {
143   bitmap_free = 0;
144   if (bitmap_obstack_init)
145     {
146       bitmap_obstack_init = FALSE;
147       obstack_free (&bitmap_obstack, NULL);
148     }
149 }
150
151 /* Return nonzero if all bits in an element are zero.  */
152
153 static INLINE int
154 bitmap_element_zerop (element)
155      bitmap_element *element;
156 {
157 #if BITMAP_ELEMENT_WORDS == 2
158   return (element->bits[0] | element->bits[1]) == 0;
159 #else
160   int i;
161
162   for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
163     if (element->bits[i] != 0)
164       return 0;
165
166   return 1;
167 #endif
168 }
169 \f
170 /* Link the bitmap element into the current bitmap linked list.  */
171
172 static INLINE void
173 bitmap_element_link (head, element)
174      bitmap head;
175      bitmap_element *element;
176 {
177   unsigned int indx = element->indx;
178   bitmap_element *ptr;
179
180   /* If this is the first and only element, set it in.  */
181   if (head->first == 0)
182     {
183       element->next = element->prev = 0;
184       head->first = element;
185     }
186
187   /* If this index is less than that of the current element, it goes someplace
188      before the current element.  */
189   else if (indx < head->indx)
190     {
191       for (ptr = head->current;
192            ptr->prev != 0 && ptr->prev->indx > indx;
193            ptr = ptr->prev)
194         ;
195
196       if (ptr->prev)
197         ptr->prev->next = element;
198       else
199         head->first = element;
200
201       element->prev = ptr->prev;
202       element->next = ptr;
203       ptr->prev = element;
204     }
205
206   /* Otherwise, it must go someplace after the current element.  */
207   else
208     {
209       for (ptr = head->current;
210            ptr->next != 0 && ptr->next->indx < indx;
211            ptr = ptr->next)
212         ;
213
214       if (ptr->next)
215         ptr->next->prev = element;
216
217       element->next = ptr->next;
218       element->prev = ptr;
219       ptr->next = element;
220     }
221
222   /* Set up so this is the first element searched.  */
223   head->current = element;
224   head->indx = indx;
225 }
226 \f
227 /* Clear a bitmap by freeing the linked list.  */
228
229 INLINE void
230 bitmap_clear (head)
231      bitmap head;
232 {
233   bitmap_element *element, *next;
234
235   for (element = head->first; element != 0; element = next)
236     {
237       next = element->next;
238       element->next = bitmap_free;
239       bitmap_free = element;
240     }
241
242   head->first = head->current =  0;
243 }
244 \f
245 /* Copy a bitmap to another bitmap */
246
247 void
248 bitmap_copy (to, from)
249      bitmap to;
250      bitmap from;
251 {
252   bitmap_element *from_ptr, *to_ptr = 0;
253 #if BITMAP_ELEMENT_WORDS != 2
254   int i;
255 #endif
256
257   bitmap_clear (to);
258
259   /* Copy elements in forward direction one at a time */
260   for (from_ptr = from->first; from_ptr; from_ptr = from_ptr->next)
261     {
262       bitmap_element *to_elt = bitmap_element_allocate ();
263
264       to_elt->indx = from_ptr->indx;
265
266 #if BITMAP_ELEMENT_WORDS == 2
267       to_elt->bits[0] = from_ptr->bits[0];
268       to_elt->bits[1] = from_ptr->bits[1];
269 #else
270       for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
271         to_elt->bits[i] = from_ptr->bits[i];
272 #endif
273
274       /* Here we have a special case of bitmap_element_link, for the case
275          where we know the links are being entered in sequence.  */
276       if (to_ptr == 0)
277         {
278           to->first = to->current = to_elt;
279           to->indx = from_ptr->indx;
280           to_elt->next = to_elt->prev = 0;
281         }
282       else
283         {
284           to_elt->prev = to_ptr;
285           to_elt->next = 0;
286           to_ptr->next = to_elt;
287         }
288
289       to_ptr = to_elt;
290     }
291 }
292 \f
293 /* Find a bitmap element that would hold a bitmap's bit.
294    Update the `current' field even if we can't find an element that
295    would hold the bitmap's bit to make eventual allocation
296    faster.  */
297
298 static INLINE bitmap_element *
299 bitmap_find_bit (head, bit)
300      bitmap head;
301      unsigned int bit;
302 {
303   bitmap_element *element;
304   unsigned HOST_WIDE_INT indx = bit / BITMAP_ELEMENT_ALL_BITS;
305
306   if (head->current == 0)
307     return 0;
308
309   if (head->indx > indx)
310     for (element = head->current;
311          element->prev != 0 && element->indx > indx;
312          element = element->prev)
313       ;
314
315   else
316     for (element = head->current;
317          element->next != 0 && element->indx < indx;
318          element = element->next)
319       ;
320
321   /* `element' is the nearest to the one we want.  If it's not the one we
322      want, the one we want doesn't exist.  */
323   head->current = element;
324   head->indx = element->indx;
325   if (element != 0 && element->indx != indx)
326     element = 0;
327
328   return element;
329 }
330 \f
331 /* Clear a single bit in a bitmap.  */
332
333 void
334 bitmap_clear_bit (head, bit)
335      bitmap head;
336      int bit;
337 {
338   bitmap_element *ptr = bitmap_find_bit (head, bit);
339
340   if (ptr != 0)
341     {
342       unsigned bit_num  = bit % (unsigned) HOST_BITS_PER_WIDE_INT;
343       unsigned word_num = ((bit / (unsigned) HOST_BITS_PER_WIDE_INT)
344                            % BITMAP_ELEMENT_WORDS);
345       ptr->bits[word_num] &= ~ (((unsigned HOST_WIDE_INT) 1) << bit_num);
346
347       /* If we cleared the entire word, free up the element */
348       if (bitmap_element_zerop (ptr))
349         bitmap_element_free (head, ptr);
350     }
351 }
352
353 \f
354 /* Set a single bit in a bitmap.  */
355
356 void
357 bitmap_set_bit (head, bit)
358      bitmap head;
359      int bit;
360 {
361   bitmap_element *ptr = bitmap_find_bit (head, bit);
362   unsigned word_num
363     = ((bit / (unsigned) HOST_BITS_PER_WIDE_INT) % BITMAP_ELEMENT_WORDS);
364   unsigned bit_num  = bit % (unsigned) HOST_BITS_PER_WIDE_INT;
365   unsigned HOST_WIDE_INT bit_val = ((unsigned HOST_WIDE_INT) 1) << bit_num;
366
367   if (ptr == 0)
368     {
369       ptr = bitmap_element_allocate ();
370       ptr->indx = bit / BITMAP_ELEMENT_ALL_BITS;
371       ptr->bits[word_num] = bit_val;
372       bitmap_element_link (head, ptr);
373     }
374   else
375     ptr->bits[word_num] |= bit_val;
376 }
377 \f
378 /* Return whether a bit is set within a bitmap.  */
379
380 int
381 bitmap_bit_p (head, bit)
382      bitmap head;
383      int bit;
384 {
385   bitmap_element *ptr;
386   unsigned bit_num;
387   unsigned word_num;
388
389   ptr = bitmap_find_bit (head, bit);
390   if (ptr == 0)
391     return 0;
392
393   bit_num = bit % (unsigned) HOST_BITS_PER_WIDE_INT;
394   word_num
395     = ((bit / (unsigned) HOST_BITS_PER_WIDE_INT) % BITMAP_ELEMENT_WORDS);
396
397   return (ptr->bits[word_num] >> bit_num) & 1;
398 }
399 \f
400
401 int 
402 bitmap_first_set_bit (a)
403      bitmap a;
404 {
405   bitmap_element *ptr = a->first;
406   unsigned HOST_WIDE_INT word;
407   unsigned word_num, bit_num;
408
409   if (ptr == NULL)
410     return -1;
411
412 #if BITMAP_ELEMENT_WORDS == 2
413   word_num = 0, word = ptr->bits[0];
414   if (word == 0)
415     word_num = 1, word = ptr->bits[1];
416 #else
417   for (word_num = 0; word_num < BITMAP_ELEMENT_WORDS; ++word_num)
418     if ((word = ptr->bits[word_num]) != 0)
419       break;
420 #endif
421
422   /* Binary search for the first set bit.  */
423   /* ??? It'd be nice to know if ffs or ffsl was available.  */
424
425   bit_num = 0;
426   word = word & -word;
427
428 #if HOST_BITS_PER_WIDE_INT > 64
429  #error "Fill out the table."
430 #endif
431 #if HOST_BITS_PER_WIDE_INT > 32
432   if ((word & 0xffffffff) == 0)
433     word >>= 32, bit_num += 32;
434 #endif
435   if ((word & 0xffff) == 0)
436     word >>= 16, bit_num += 16;
437   if ((word & 0xff) == 0)
438     word >>= 8, bit_num += 8;
439   if (word & 0xf0)
440     bit_num += 4;
441   if (word & 0xcc)
442     bit_num += 2;
443   if (word & 0xaa)
444     bit_num += 1;
445
446   return (ptr->indx * BITMAP_ELEMENT_ALL_BITS
447           + word_num * HOST_BITS_PER_WIDE_INT
448           + bit_num);
449 }
450
451 int 
452 bitmap_last_set_bit (a)
453      bitmap a;
454 {
455   bitmap_element *ptr = a->first;
456   unsigned HOST_WIDE_INT word;
457   unsigned word_num, bit_num;
458
459   if (ptr == NULL)
460     return -1;
461
462   while (ptr->next != NULL)
463     ptr = ptr->next;
464
465 #if BITMAP_ELEMENT_WORDS == 2
466   word_num = 1, word = ptr->bits[1];
467   if (word == 0)
468     word_num = 0, word = ptr->bits[0];
469 #else
470   for (word_num = BITMAP_ELEMENT_WORDS; word_num-- > 0; )
471     if ((word = ptr->bits[word_num]) != 0)
472       break;
473 #endif
474
475   /* Binary search for the last set bit.  */
476
477   bit_num = 0;
478 #if HOST_BITS_PER_WIDE_INT > 64
479  #error "Fill out the table."
480 #endif
481 #if HOST_BITS_PER_WIDE_INT > 32
482   if (word & ~ (unsigned HOST_WIDE_INT) 0xffffffff)
483     word >>= 32, bit_num += 32;
484 #endif
485   if (word & 0xffff0000)
486     word >>= 16, bit_num += 16;
487   if (word & 0xff00)
488     word >>= 8, bit_num += 8;
489   if (word & 0xf0)
490     word >>= 4, bit_num += 4;
491   if (word & 0xc)
492     word >>= 2, bit_num += 2;
493   if (word & 0x2)
494     word >>= 1, bit_num += 1;
495
496   return (ptr->indx * BITMAP_ELEMENT_ALL_BITS
497           + word_num * HOST_BITS_PER_WIDE_INT
498           + bit_num);
499 }
500 \f
501 /* Store in bitmap TO the result of combining bitmap FROM1 and FROM2 using
502    a specific bit manipulation.  Return true if TO changes.  */
503
504 int
505 bitmap_operation (to, from1, from2, operation)
506      bitmap to;
507      bitmap from1;
508      bitmap from2;
509      enum bitmap_bits operation;
510 {
511 #define HIGHEST_INDEX (unsigned int) ~0
512
513   bitmap_element *from1_ptr = from1->first;
514   bitmap_element *from2_ptr = from2->first;
515   unsigned int indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX;
516   unsigned int indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX;
517   bitmap_element *to_ptr = to->first;
518   bitmap_element *from1_tmp;
519   bitmap_element *from2_tmp;
520   bitmap_element *to_tmp;
521   unsigned int indx;
522   int changed = 0;
523
524 #if BITMAP_ELEMENT_WORDS == 2
525 #define DOIT(OP)                                        \
526   do {                                                  \
527     unsigned HOST_WIDE_INT t0, t1, f10, f11, f20, f21;  \
528     f10 = from1_tmp->bits[0];                           \
529     f20 = from2_tmp->bits[0];                           \
530     t0 = f10 OP f20;                                    \
531     changed |= (t0 != to_tmp->bits[0]);                 \
532     f11 = from1_tmp->bits[1];                           \
533     f21 = from2_tmp->bits[1];                           \
534     t1 = f11 OP f21;                                    \
535     changed |= (t1 != to_tmp->bits[1]);                 \
536     to_tmp->bits[0] = t0;                               \
537     to_tmp->bits[1] = t1;                               \
538   } while (0)
539 #else
540 #define DOIT(OP)                                        \
541   do {                                                  \
542     unsigned HOST_WIDE_INT t, f1, f2;                   \
543     int i;                                              \
544     for (i = 0; i < BITMAP_ELEMENT_WORDS; ++i)          \
545       {                                                 \
546         f1 = from1_tmp->bits[i];                        \
547         f2 = from2_tmp->bits[i];                        \
548         t = f1 OP f2;                                   \
549         changed |= (t != to_tmp->bits[i]);              \
550         to_tmp->bits[i] = t;                            \
551       }                                                 \
552   } while (0)
553 #endif
554
555   to->first = to->current = 0;
556
557   while (from1_ptr != 0 || from2_ptr != 0)
558     {
559       /* Figure out whether we need to substitute zero elements for
560          missing links.  */
561       if (indx1 == indx2)
562         {
563           indx = indx1;
564           from1_tmp = from1_ptr;
565           from2_tmp = from2_ptr;
566           from1_ptr = from1_ptr->next;
567           indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX;
568           from2_ptr = from2_ptr->next;
569           indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX;
570         }
571       else if (indx1 < indx2)
572         {
573           indx = indx1;
574           from1_tmp = from1_ptr;
575           from2_tmp = &bitmap_zero;
576           from1_ptr = from1_ptr->next;
577           indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX;
578         }
579       else
580         {
581           indx = indx2;
582           from1_tmp = &bitmap_zero;
583           from2_tmp = from2_ptr;
584           from2_ptr = from2_ptr->next;
585           indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX;
586         }
587
588       /* Find the appropriate element from TO.  Begin by discarding
589          elements that we've skipped. */
590       while (to_ptr && to_ptr->indx < indx)
591         {
592           changed = 1;
593           to_tmp = to_ptr;
594           to_ptr = to_ptr->next;
595           to_tmp->next = bitmap_free;
596           bitmap_free = to_tmp;
597         }
598       if (to_ptr && to_ptr->indx == indx)
599         {
600           to_tmp = to_ptr;
601           to_ptr = to_ptr->next;
602         }
603       else
604         to_tmp = bitmap_element_allocate ();
605
606       /* Do the operation, and if any bits are set, link it into the
607          linked list.  */
608       switch (operation)
609         {
610         default:
611           abort ();
612
613         case BITMAP_AND:
614           DOIT (&);
615           break;
616
617         case BITMAP_AND_COMPL:
618           DOIT (&~);
619           break;
620
621         case BITMAP_IOR:
622           DOIT (|);
623           break;
624         case BITMAP_IOR_COMPL:
625           DOIT (|~);
626           break;
627         case BITMAP_XOR:
628           DOIT (^);
629           break;
630         }
631
632       if (! bitmap_element_zerop (to_tmp))
633         {
634           to_tmp->indx = indx;
635           bitmap_element_link (to, to_tmp);
636         }
637       else
638         {
639           to_tmp->next = bitmap_free;
640           bitmap_free = to_tmp;
641         }
642     }
643
644   /* If we have elements of TO left over, free the lot.  */
645   if (to_ptr)
646     {
647       changed = 1;
648       for (to_tmp = to_ptr; to_tmp->next ; to_tmp = to_tmp->next)
649         continue;
650       to_tmp->next = bitmap_free;
651       bitmap_free = to_ptr;
652     }
653
654 #undef DOIT
655
656   return changed;
657 }
658
659 /* Return true if two bitmaps are identical.  */
660
661 int
662 bitmap_equal_p (a, b)
663      bitmap a;
664      bitmap b;
665 {
666   bitmap_head c;
667   int ret;
668
669   c.first = c.current = 0;
670   ret = ! bitmap_operation (&c, a, b, BITMAP_XOR);
671   bitmap_clear (&c);
672
673   return ret;
674 }
675 \f
676 /* Or into bitmap TO bitmap FROM1 and'ed with the complement of
677    bitmap FROM2. */
678
679 void
680 bitmap_ior_and_compl (to, from1, from2)
681      bitmap to;
682      bitmap from1;
683      bitmap from2;
684 {
685   bitmap_head tmp;
686
687   tmp.first = tmp.current = 0;
688
689   bitmap_operation (&tmp, from1, from2, BITMAP_AND_COMPL);
690   bitmap_operation (to, to, &tmp, BITMAP_IOR);
691   bitmap_clear (&tmp);
692 }
693
694 int
695 bitmap_union_of_diff (dst, a, b, c)
696      bitmap dst;
697      bitmap a;
698      bitmap b;
699      bitmap c;
700 {
701   bitmap_head tmp;
702   int changed;
703
704   tmp.first = tmp.current = 0;
705
706   bitmap_operation (&tmp, b, c, BITMAP_AND_COMPL);
707   changed = bitmap_operation (dst, &tmp, a, BITMAP_IOR);
708   bitmap_clear (&tmp);
709
710   return changed;
711 }
712 \f
713 /* Initialize a bitmap header.  */
714
715 bitmap
716 bitmap_initialize (head)
717      bitmap head;
718 {
719   head->first = head->current = 0;
720
721   return head;
722 }
723 \f
724 /* Debugging function to print out the contents of a bitmap.  */
725
726 void
727 debug_bitmap_file (file, head)
728      FILE *file;
729      bitmap head;
730 {
731   bitmap_element *ptr;
732
733   fprintf (file, "\nfirst = ");
734   fprintf (file, HOST_PTR_PRINTF, (PTR) head->first);
735   fprintf (file, " current = ");
736   fprintf (file, HOST_PTR_PRINTF, (PTR) head->current);
737   fprintf (file, " indx = %u\n", head->indx);
738
739   for (ptr = head->first; ptr; ptr = ptr->next)
740     {
741       int i, j, col = 26;
742
743       fprintf (file, "\t");
744       fprintf (file, HOST_PTR_PRINTF, (PTR) ptr);
745       fprintf (file, " next = ");
746       fprintf (file, HOST_PTR_PRINTF, (PTR) ptr->next);
747       fprintf (file, " prev = ");
748       fprintf (file, HOST_PTR_PRINTF, (PTR) ptr->prev);
749       fprintf (file, " indx = %u\n\t\tbits = {", ptr->indx);
750
751       for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
752         for (j = 0; j < HOST_BITS_PER_WIDE_INT; j++)
753           if ((ptr->bits[i] >> j) & 1)
754             {
755               if (col > 70)
756                 {
757                   fprintf (file, "\n\t\t\t");
758                   col = 24;
759                 }
760
761               fprintf (file, " %u", (ptr->indx * BITMAP_ELEMENT_ALL_BITS
762                                      + i * HOST_BITS_PER_WIDE_INT + j));
763               col += 4;
764             }
765
766       fprintf (file, " }\n");
767     }
768 }
769 \f
770 /* Function to be called from the debugger to print the contents
771    of a bitmap.  */
772
773 void
774 debug_bitmap (head)
775      bitmap head;
776 {
777   debug_bitmap_file (stdout, head);
778 }
779 \f
780 /* Function to print out the contents of a bitmap.  Unlike debug_bitmap_file,
781    it does not print anything but the bits.  */
782
783 void
784 bitmap_print (file, head, prefix, suffix)
785      FILE *file;
786      bitmap head;
787      const char *prefix;
788      const char *suffix;
789 {
790   const char *comma = "";
791   int i;
792
793   fputs (prefix, file);
794   EXECUTE_IF_SET_IN_BITMAP (head, 0, i,
795                             {
796                               fprintf (file, "%s%d", comma, i);
797                               comma = ", ";
798                             });
799   fputs (suffix, file);
800 }