OSDN Git Service

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