Commit e326eeb5 by Kaveh R. Ghazi Committed by Kaveh Ghazi

bitmap.c (hash_descriptor, [...]): Constify.

	* bitmap.c (hash_descriptor, eq_descriptor, bitmap_element_zerop,
	bitmap_copy, bitmap_clear_bit, popcount_table, bitmap_count_bits,
	bitmap_first_set_bit, bitmap_and, bitmap_and_into,
	bitmap_elt_copy, bitmap_and_compl, bitmap_and_compl_into,
	bitmap_compl_and_into, bitmap_elt_ior, bitmap_ior,
	bitmap_ior_into, bitmap_xor, bitmap_xor_into, bitmap_equal_p,
	bitmap_intersect_p, bitmap_intersect_compl_p,
	bitmap_ior_and_compl, bitmap_ior_and_compl_into,
	debug_bitmap_file, debug_bitmap, bitmap_print, bitmap_hash):
	Constify.
	* bitmap.h (bitmap_copy, bitmap_equal_p, bitmap_intersect_p,
	bitmap_intersect_compl_p, bitmap_count_bits, bitmap_and,
	bitmap_and_into, bitmap_and_compl, bitmap_and_compl_into,
	bitmap_compl_and_into, bitmap_ior, bitmap_ior_into, bitmap_xor,
	bitmap_xor_into, bitmap_ior_and_compl, bitmap_ior_and_compl_into,
	debug_bitmap, debug_bitmap_file, bitmap_print,
	bitmap_first_set_bit, bitmap_hash, bmp_iter_set_init,
	bmp_iter_and_init, bmp_iter_and_compl_init): Likewise.

From-SVN: r126928
parent 4352ed4d
2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* bitmap.c (hash_descriptor, eq_descriptor, bitmap_element_zerop,
bitmap_copy, bitmap_clear_bit, popcount_table, bitmap_count_bits,
bitmap_first_set_bit, bitmap_and, bitmap_and_into,
bitmap_elt_copy, bitmap_and_compl, bitmap_and_compl_into,
bitmap_compl_and_into, bitmap_elt_ior, bitmap_ior,
bitmap_ior_into, bitmap_xor, bitmap_xor_into, bitmap_equal_p,
bitmap_intersect_p, bitmap_intersect_compl_p,
bitmap_ior_and_compl, bitmap_ior_and_compl_into,
debug_bitmap_file, debug_bitmap, bitmap_print, bitmap_hash):
Constify.
* bitmap.h (bitmap_copy, bitmap_equal_p, bitmap_intersect_p,
bitmap_intersect_compl_p, bitmap_count_bits, bitmap_and,
bitmap_and_into, bitmap_and_compl, bitmap_and_compl_into,
bitmap_compl_and_into, bitmap_ior, bitmap_ior_into, bitmap_xor,
bitmap_xor_into, bitmap_ior_and_compl, bitmap_ior_and_compl_into,
debug_bitmap, debug_bitmap_file, bitmap_print,
bitmap_first_set_bit, bitmap_hash, bmp_iter_set_init,
bmp_iter_and_init, bmp_iter_and_compl_init): Likewise.
2007-07-25 Daniel Berlin <dberlin@dberlin.org> 2007-07-25 Daniel Berlin <dberlin@dberlin.org>
* config/darwin.c (darwin_override_options): Additional fix for * config/darwin.c (darwin_override_options): Additional fix for
......
...@@ -52,7 +52,7 @@ static htab_t bitmap_desc_hash; ...@@ -52,7 +52,7 @@ static htab_t bitmap_desc_hash;
static hashval_t static hashval_t
hash_descriptor (const void *p) hash_descriptor (const void *p)
{ {
const struct bitmap_descriptor *d = p; const struct bitmap_descriptor *const d = p;
return htab_hash_pointer (d->file) + d->line; return htab_hash_pointer (d->file) + d->line;
} }
struct loc struct loc
...@@ -64,8 +64,8 @@ struct loc ...@@ -64,8 +64,8 @@ struct loc
static int static int
eq_descriptor (const void *p1, const void *p2) eq_descriptor (const void *p1, const void *p2)
{ {
const struct bitmap_descriptor *d = p1; const struct bitmap_descriptor *const d = p1;
const struct loc *l = p2; const struct loc *const l = p2;
return d->file == l->file && d->function == l->function && d->line == l->line; return d->file == l->file && d->function == l->function && d->line == l->line;
} }
...@@ -126,7 +126,7 @@ static GTY((deletable)) bitmap_element *bitmap_ggc_free; /* Freelist of ...@@ -126,7 +126,7 @@ static GTY((deletable)) bitmap_element *bitmap_ggc_free; /* Freelist of
static void bitmap_elem_to_freelist (bitmap, bitmap_element *); static void bitmap_elem_to_freelist (bitmap, bitmap_element *);
static void bitmap_element_free (bitmap, bitmap_element *); static void bitmap_element_free (bitmap, bitmap_element *);
static bitmap_element *bitmap_element_allocate (bitmap); static bitmap_element *bitmap_element_allocate (bitmap);
static int bitmap_element_zerop (bitmap_element *); static int bitmap_element_zerop (const bitmap_element *);
static void bitmap_element_link (bitmap, bitmap_element *); static void bitmap_element_link (bitmap, bitmap_element *);
static bitmap_element *bitmap_elt_insert_after (bitmap, bitmap_element *, unsigned int); static bitmap_element *bitmap_elt_insert_after (bitmap, bitmap_element *, unsigned int);
static void bitmap_elt_clear_from (bitmap, bitmap_element *); static void bitmap_elt_clear_from (bitmap, bitmap_element *);
...@@ -390,7 +390,7 @@ bitmap_obstack_free (bitmap map) ...@@ -390,7 +390,7 @@ bitmap_obstack_free (bitmap map)
/* Return nonzero if all bits in an element are zero. */ /* Return nonzero if all bits in an element are zero. */
static inline int static inline int
bitmap_element_zerop (bitmap_element *element) bitmap_element_zerop (const bitmap_element *element)
{ {
#if BITMAP_ELEMENT_WORDS == 2 #if BITMAP_ELEMENT_WORDS == 2
return (element->bits[0] | element->bits[1]) == 0; return (element->bits[0] | element->bits[1]) == 0;
...@@ -498,9 +498,10 @@ bitmap_elt_insert_after (bitmap head, bitmap_element *elt, unsigned int indx) ...@@ -498,9 +498,10 @@ bitmap_elt_insert_after (bitmap head, bitmap_element *elt, unsigned int indx)
/* Copy a bitmap to another bitmap. */ /* Copy a bitmap to another bitmap. */
void void
bitmap_copy (bitmap to, bitmap from) bitmap_copy (bitmap to, const_bitmap from)
{ {
bitmap_element *from_ptr, *to_ptr = 0; const bitmap_element *from_ptr;
bitmap_element *to_ptr = 0;
bitmap_clear (to); bitmap_clear (to);
...@@ -588,7 +589,7 @@ bitmap_find_bit (bitmap head, unsigned int bit) ...@@ -588,7 +589,7 @@ bitmap_find_bit (bitmap head, unsigned int bit)
void void
bitmap_clear_bit (bitmap head, int bit) bitmap_clear_bit (bitmap head, int bit)
{ {
bitmap_element *ptr = bitmap_find_bit (head, bit); bitmap_element *const ptr = bitmap_find_bit (head, bit);
if (ptr != 0) if (ptr != 0)
{ {
...@@ -644,7 +645,7 @@ bitmap_bit_p (bitmap head, int bit) ...@@ -644,7 +645,7 @@ bitmap_bit_p (bitmap head, int bit)
#if GCC_VERSION < 3400 #if GCC_VERSION < 3400
/* Table of number of set bits in a character, indexed by value of char. */ /* Table of number of set bits in a character, indexed by value of char. */
static unsigned char popcount_table[] = static const unsigned char popcount_table[] =
{ {
0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5, 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
...@@ -671,10 +672,10 @@ bitmap_popcount (BITMAP_WORD a) ...@@ -671,10 +672,10 @@ bitmap_popcount (BITMAP_WORD a)
/* Count the number of bits set in the bitmap, and return it. */ /* Count the number of bits set in the bitmap, and return it. */
unsigned long unsigned long
bitmap_count_bits (bitmap a) bitmap_count_bits (const_bitmap a)
{ {
unsigned long count = 0; unsigned long count = 0;
bitmap_element *elt; const bitmap_element *elt;
unsigned ix; unsigned ix;
for (elt = a->first; elt; elt = elt->next) for (elt = a->first; elt; elt = elt->next)
...@@ -699,9 +700,9 @@ bitmap_count_bits (bitmap a) ...@@ -699,9 +700,9 @@ bitmap_count_bits (bitmap a)
bitmap must be non-empty. */ bitmap must be non-empty. */
unsigned unsigned
bitmap_first_set_bit (bitmap a) bitmap_first_set_bit (const_bitmap a)
{ {
bitmap_element *elt = a->first; const bitmap_element *elt = a->first;
unsigned bit_no; unsigned bit_no;
BITMAP_WORD word; BITMAP_WORD word;
unsigned ix; unsigned ix;
...@@ -750,11 +751,11 @@ bitmap_first_set_bit (bitmap a) ...@@ -750,11 +751,11 @@ bitmap_first_set_bit (bitmap a)
/* DST = A & B. */ /* DST = A & B. */
void void
bitmap_and (bitmap dst, bitmap a, bitmap b) bitmap_and (bitmap dst, const_bitmap a, const_bitmap b)
{ {
bitmap_element *dst_elt = dst->first; bitmap_element *dst_elt = dst->first;
bitmap_element *a_elt = a->first; const bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first; const bitmap_element *b_elt = b->first;
bitmap_element *dst_prev = NULL; bitmap_element *dst_prev = NULL;
gcc_assert (dst != a && dst != b); gcc_assert (dst != a && dst != b);
...@@ -808,10 +809,10 @@ bitmap_and (bitmap dst, bitmap a, bitmap b) ...@@ -808,10 +809,10 @@ bitmap_and (bitmap dst, bitmap a, bitmap b)
/* A &= B. */ /* A &= B. */
void void
bitmap_and_into (bitmap a, bitmap b) bitmap_and_into (bitmap a, const_bitmap b)
{ {
bitmap_element *a_elt = a->first; bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first; const bitmap_element *b_elt = b->first;
bitmap_element *next; bitmap_element *next;
if (a == b) if (a == b)
...@@ -859,7 +860,7 @@ bitmap_and_into (bitmap a, bitmap b) ...@@ -859,7 +860,7 @@ bitmap_and_into (bitmap a, bitmap b)
static inline bool static inline bool
bitmap_elt_copy (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev, bitmap_elt_copy (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
bitmap_element *src_elt, bool changed) const bitmap_element *src_elt, bool changed)
{ {
if (!changed && dst_elt && dst_elt->indx == src_elt->indx) if (!changed && dst_elt && dst_elt->indx == src_elt->indx)
{ {
...@@ -889,11 +890,11 @@ bitmap_elt_copy (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev, ...@@ -889,11 +890,11 @@ bitmap_elt_copy (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
/* DST = A & ~B */ /* DST = A & ~B */
bool bool
bitmap_and_compl (bitmap dst, bitmap a, bitmap b) bitmap_and_compl (bitmap dst, const_bitmap a, const_bitmap b)
{ {
bitmap_element *dst_elt = dst->first; bitmap_element *dst_elt = dst->first;
bitmap_element *a_elt = a->first; const bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first; const bitmap_element *b_elt = b->first;
bitmap_element *dst_prev = NULL; bitmap_element *dst_prev = NULL;
bitmap_element **dst_prev_pnext = &dst->first; bitmap_element **dst_prev_pnext = &dst->first;
bool changed = false; bool changed = false;
...@@ -1002,10 +1003,10 @@ bitmap_and_compl (bitmap dst, bitmap a, bitmap b) ...@@ -1002,10 +1003,10 @@ bitmap_and_compl (bitmap dst, bitmap a, bitmap b)
/* A &= ~B. Returns true if A changes */ /* A &= ~B. Returns true if A changes */
bool bool
bitmap_and_compl_into (bitmap a, bitmap b) bitmap_and_compl_into (bitmap a, const_bitmap b)
{ {
bitmap_element *a_elt = a->first; bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first; const bitmap_element *b_elt = b->first;
bitmap_element *next; bitmap_element *next;
BITMAP_WORD changed = 0; BITMAP_WORD changed = 0;
...@@ -1282,10 +1283,10 @@ bitmap_clear_range (bitmap head, unsigned int start, unsigned int count) ...@@ -1282,10 +1283,10 @@ bitmap_clear_range (bitmap head, unsigned int start, unsigned int count)
/* A = ~A & B. */ /* A = ~A & B. */
void void
bitmap_compl_and_into (bitmap a, bitmap b) bitmap_compl_and_into (bitmap a, const_bitmap b)
{ {
bitmap_element *a_elt = a->first; bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first; const bitmap_element *b_elt = b->first;
bitmap_element *a_prev = NULL; bitmap_element *a_prev = NULL;
bitmap_element *next; bitmap_element *next;
...@@ -1355,7 +1356,7 @@ bitmap_compl_and_into (bitmap a, bitmap b) ...@@ -1355,7 +1356,7 @@ bitmap_compl_and_into (bitmap a, bitmap b)
static inline bool static inline bool
bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev, bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
bitmap_element *a_elt, bitmap_element *b_elt, const bitmap_element *a_elt, const bitmap_element *b_elt,
bool changed) bool changed)
{ {
gcc_assert (a_elt || b_elt); gcc_assert (a_elt || b_elt);
...@@ -1394,7 +1395,7 @@ bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev, ...@@ -1394,7 +1395,7 @@ bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
else else
{ {
/* Copy a single element. */ /* Copy a single element. */
bitmap_element *src; const bitmap_element *src;
if (!b_elt || (a_elt && a_elt->indx < b_elt->indx)) if (!b_elt || (a_elt && a_elt->indx < b_elt->indx))
src = a_elt; src = a_elt;
...@@ -1411,11 +1412,11 @@ bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev, ...@@ -1411,11 +1412,11 @@ bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
/* DST = A | B. Return true if DST changes. */ /* DST = A | B. Return true if DST changes. */
bool bool
bitmap_ior (bitmap dst, bitmap a, bitmap b) bitmap_ior (bitmap dst, const_bitmap a, const_bitmap b)
{ {
bitmap_element *dst_elt = dst->first; bitmap_element *dst_elt = dst->first;
bitmap_element *a_elt = a->first; const bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first; const bitmap_element *b_elt = b->first;
bitmap_element *dst_prev = NULL; bitmap_element *dst_prev = NULL;
bitmap_element **dst_prev_pnext = &dst->first; bitmap_element **dst_prev_pnext = &dst->first;
bool changed = false; bool changed = false;
...@@ -1458,10 +1459,10 @@ bitmap_ior (bitmap dst, bitmap a, bitmap b) ...@@ -1458,10 +1459,10 @@ bitmap_ior (bitmap dst, bitmap a, bitmap b)
/* A |= B. Return true if A changes. */ /* A |= B. Return true if A changes. */
bool bool
bitmap_ior_into (bitmap a, bitmap b) bitmap_ior_into (bitmap a, const_bitmap b)
{ {
bitmap_element *a_elt = a->first; bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first; const bitmap_element *b_elt = b->first;
bitmap_element *a_prev = NULL; bitmap_element *a_prev = NULL;
bitmap_element **a_prev_pnext = &a->first; bitmap_element **a_prev_pnext = &a->first;
bool changed = false; bool changed = false;
...@@ -1497,11 +1498,11 @@ bitmap_ior_into (bitmap a, bitmap b) ...@@ -1497,11 +1498,11 @@ bitmap_ior_into (bitmap a, bitmap b)
/* DST = A ^ B */ /* DST = A ^ B */
void void
bitmap_xor (bitmap dst, bitmap a, bitmap b) bitmap_xor (bitmap dst, const_bitmap a, const_bitmap b)
{ {
bitmap_element *dst_elt = dst->first; bitmap_element *dst_elt = dst->first;
bitmap_element *a_elt = a->first; const bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first; const bitmap_element *b_elt = b->first;
bitmap_element *dst_prev = NULL; bitmap_element *dst_prev = NULL;
gcc_assert (dst != a && dst != b); gcc_assert (dst != a && dst != b);
...@@ -1541,7 +1542,7 @@ bitmap_xor (bitmap dst, bitmap a, bitmap b) ...@@ -1541,7 +1542,7 @@ bitmap_xor (bitmap dst, bitmap a, bitmap b)
else else
{ {
/* Copy a single element. */ /* Copy a single element. */
bitmap_element *src; const bitmap_element *src;
if (!b_elt || (a_elt && a_elt->indx < b_elt->indx)) if (!b_elt || (a_elt && a_elt->indx < b_elt->indx))
{ {
...@@ -1574,10 +1575,10 @@ bitmap_xor (bitmap dst, bitmap a, bitmap b) ...@@ -1574,10 +1575,10 @@ bitmap_xor (bitmap dst, bitmap a, bitmap b)
/* A ^= B */ /* A ^= B */
void void
bitmap_xor_into (bitmap a, bitmap b) bitmap_xor_into (bitmap a, const_bitmap b)
{ {
bitmap_element *a_elt = a->first; bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first; const bitmap_element *b_elt = b->first;
bitmap_element *a_prev = NULL; bitmap_element *a_prev = NULL;
if (a == b) if (a == b)
...@@ -1633,10 +1634,10 @@ bitmap_xor_into (bitmap a, bitmap b) ...@@ -1633,10 +1634,10 @@ bitmap_xor_into (bitmap a, bitmap b)
occurs in practice. */ occurs in practice. */
bool bool
bitmap_equal_p (bitmap a, bitmap b) bitmap_equal_p (const_bitmap a, const_bitmap b)
{ {
bitmap_element *a_elt; const bitmap_element *a_elt;
bitmap_element *b_elt; const bitmap_element *b_elt;
unsigned ix; unsigned ix;
for (a_elt = a->first, b_elt = b->first; for (a_elt = a->first, b_elt = b->first;
...@@ -1655,10 +1656,10 @@ bitmap_equal_p (bitmap a, bitmap b) ...@@ -1655,10 +1656,10 @@ bitmap_equal_p (bitmap a, bitmap b)
/* Return true if A AND B is not empty. */ /* Return true if A AND B is not empty. */
bool bool
bitmap_intersect_p (bitmap a, bitmap b) bitmap_intersect_p (const_bitmap a, const_bitmap b)
{ {
bitmap_element *a_elt; const bitmap_element *a_elt;
bitmap_element *b_elt; const bitmap_element *b_elt;
unsigned ix; unsigned ix;
for (a_elt = a->first, b_elt = b->first; for (a_elt = a->first, b_elt = b->first;
...@@ -1683,10 +1684,10 @@ bitmap_intersect_p (bitmap a, bitmap b) ...@@ -1683,10 +1684,10 @@ bitmap_intersect_p (bitmap a, bitmap b)
/* Return true if A AND NOT B is not empty. */ /* Return true if A AND NOT B is not empty. */
bool bool
bitmap_intersect_compl_p (bitmap a, bitmap b) bitmap_intersect_compl_p (const_bitmap a, const_bitmap b)
{ {
bitmap_element *a_elt; const bitmap_element *a_elt;
bitmap_element *b_elt; const bitmap_element *b_elt;
unsigned ix; unsigned ix;
for (a_elt = a->first, b_elt = b->first; for (a_elt = a->first, b_elt = b->first;
a_elt && b_elt;) a_elt && b_elt;)
...@@ -1711,14 +1712,14 @@ bitmap_intersect_compl_p (bitmap a, bitmap b) ...@@ -1711,14 +1712,14 @@ bitmap_intersect_compl_p (bitmap a, bitmap b)
/* DST = A | (FROM1 & ~FROM2). Return true if DST changes. */ /* DST = A | (FROM1 & ~FROM2). Return true if DST changes. */
bool bool
bitmap_ior_and_compl (bitmap dst, bitmap a, bitmap b, bitmap kill) bitmap_ior_and_compl (bitmap dst, const_bitmap a, const_bitmap b, const_bitmap kill)
{ {
bool changed = false; bool changed = false;
bitmap_element *dst_elt = dst->first; bitmap_element *dst_elt = dst->first;
bitmap_element *a_elt = a->first; const bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first; const bitmap_element *b_elt = b->first;
bitmap_element *kill_elt = kill->first; const bitmap_element *kill_elt = kill->first;
bitmap_element *dst_prev = NULL; bitmap_element *dst_prev = NULL;
bitmap_element **dst_prev_pnext = &dst->first; bitmap_element **dst_prev_pnext = &dst->first;
...@@ -1815,7 +1816,7 @@ bitmap_ior_and_compl (bitmap dst, bitmap a, bitmap b, bitmap kill) ...@@ -1815,7 +1816,7 @@ bitmap_ior_and_compl (bitmap dst, bitmap a, bitmap b, bitmap kill)
/* A |= (FROM1 & ~FROM2). Return true if A changes. */ /* A |= (FROM1 & ~FROM2). Return true if A changes. */
bool bool
bitmap_ior_and_compl_into (bitmap a, bitmap from1, bitmap from2) bitmap_ior_and_compl_into (bitmap a, const_bitmap from1, const_bitmap from2)
{ {
bitmap_head tmp; bitmap_head tmp;
bool changed; bool changed;
...@@ -1832,9 +1833,9 @@ bitmap_ior_and_compl_into (bitmap a, bitmap from1, bitmap from2) ...@@ -1832,9 +1833,9 @@ bitmap_ior_and_compl_into (bitmap a, bitmap from1, bitmap from2)
/* Debugging function to print out the contents of a bitmap. */ /* Debugging function to print out the contents of a bitmap. */
void void
debug_bitmap_file (FILE *file, bitmap head) debug_bitmap_file (FILE *file, const_bitmap head)
{ {
bitmap_element *ptr; const bitmap_element *ptr;
fprintf (file, "\nfirst = %p current = %p indx = %u\n", fprintf (file, "\nfirst = %p current = %p indx = %u\n",
(void *) head->first, (void *) head->current, head->indx); (void *) head->first, (void *) head->current, head->indx);
...@@ -1844,7 +1845,8 @@ debug_bitmap_file (FILE *file, bitmap head) ...@@ -1844,7 +1845,8 @@ debug_bitmap_file (FILE *file, bitmap head)
unsigned int i, j, col = 26; unsigned int i, j, col = 26;
fprintf (file, "\t%p next = %p prev = %p indx = %u\n\t\tbits = {", fprintf (file, "\t%p next = %p prev = %p indx = %u\n\t\tbits = {",
(void*) ptr, (void*) ptr->next, (void*) ptr->prev, ptr->indx); (const void*) ptr, (const void*) ptr->next,
(const void*) ptr->prev, ptr->indx);
for (i = 0; i < BITMAP_ELEMENT_WORDS; i++) for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
for (j = 0; j < BITMAP_WORD_BITS; j++) for (j = 0; j < BITMAP_WORD_BITS; j++)
...@@ -1869,7 +1871,7 @@ debug_bitmap_file (FILE *file, bitmap head) ...@@ -1869,7 +1871,7 @@ debug_bitmap_file (FILE *file, bitmap head)
of a bitmap. */ of a bitmap. */
void void
debug_bitmap (bitmap head) debug_bitmap (const_bitmap head)
{ {
debug_bitmap_file (stdout, head); debug_bitmap_file (stdout, head);
} }
...@@ -1878,7 +1880,7 @@ debug_bitmap (bitmap head) ...@@ -1878,7 +1880,7 @@ debug_bitmap (bitmap head)
it does not print anything but the bits. */ it does not print anything but the bits. */
void void
bitmap_print (FILE *file, bitmap head, const char *prefix, const char *suffix) bitmap_print (FILE *file, const_bitmap head, const char *prefix, const char *suffix)
{ {
const char *comma = ""; const char *comma = "";
unsigned i; unsigned i;
...@@ -1953,9 +1955,9 @@ dump_bitmap_statistics (void) ...@@ -1953,9 +1955,9 @@ dump_bitmap_statistics (void)
/* Compute hash of bitmap (for purposes of hashing). */ /* Compute hash of bitmap (for purposes of hashing). */
hashval_t hashval_t
bitmap_hash (bitmap head) bitmap_hash (const_bitmap head)
{ {
bitmap_element *ptr; const bitmap_element *ptr;
BITMAP_WORD hash = 0; BITMAP_WORD hash = 0;
int ix; int ix;
......
...@@ -93,45 +93,45 @@ extern bitmap_obstack bitmap_default_obstack; /* Default bitmap obstack */ ...@@ -93,45 +93,45 @@ extern bitmap_obstack bitmap_default_obstack; /* Default bitmap obstack */
extern void bitmap_clear (bitmap); extern void bitmap_clear (bitmap);
/* Copy a bitmap to another bitmap. */ /* Copy a bitmap to another bitmap. */
extern void bitmap_copy (bitmap, bitmap); extern void bitmap_copy (bitmap, const_bitmap);
/* True if two bitmaps are identical. */ /* True if two bitmaps are identical. */
extern bool bitmap_equal_p (bitmap, bitmap); extern bool bitmap_equal_p (const_bitmap, const_bitmap);
/* True if the bitmaps intersect (their AND is non-empty). */ /* True if the bitmaps intersect (their AND is non-empty). */
extern bool bitmap_intersect_p (bitmap, bitmap); extern bool bitmap_intersect_p (const_bitmap, const_bitmap);
/* True if the complement of the second intersects the first (their /* True if the complement of the second intersects the first (their
AND_COMPL is non-empty). */ AND_COMPL is non-empty). */
extern bool bitmap_intersect_compl_p (bitmap, bitmap); extern bool bitmap_intersect_compl_p (const_bitmap, const_bitmap);
/* True if MAP is an empty bitmap. */ /* True if MAP is an empty bitmap. */
#define bitmap_empty_p(MAP) (!(MAP)->first) #define bitmap_empty_p(MAP) (!(MAP)->first)
/* Count the number of bits set in the bitmap. */ /* Count the number of bits set in the bitmap. */
extern unsigned long bitmap_count_bits (bitmap); extern unsigned long bitmap_count_bits (const_bitmap);
/* Boolean operations on bitmaps. The _into variants are two operand /* Boolean operations on bitmaps. The _into variants are two operand
versions that modify the first source operand. The other variants versions that modify the first source operand. The other variants
are three operand versions that to not destroy the source bitmaps. are three operand versions that to not destroy the source bitmaps.
The operations supported are &, & ~, |, ^. */ The operations supported are &, & ~, |, ^. */
extern void bitmap_and (bitmap, bitmap, bitmap); extern void bitmap_and (bitmap, const_bitmap, const_bitmap);
extern void bitmap_and_into (bitmap, bitmap); extern void bitmap_and_into (bitmap, const_bitmap);
extern bool bitmap_and_compl (bitmap, bitmap, bitmap); extern bool bitmap_and_compl (bitmap, const_bitmap, const_bitmap);
extern bool bitmap_and_compl_into (bitmap, bitmap); extern bool bitmap_and_compl_into (bitmap, const_bitmap);
#define bitmap_compl_and(DST, A, B) bitmap_and_compl (DST, B, A) #define bitmap_compl_and(DST, A, B) bitmap_and_compl (DST, B, A)
extern void bitmap_compl_and_into (bitmap, bitmap); extern void bitmap_compl_and_into (bitmap, const_bitmap);
extern void bitmap_clear_range (bitmap, unsigned int, unsigned int); extern void bitmap_clear_range (bitmap, unsigned int, unsigned int);
extern void bitmap_set_range (bitmap, unsigned int, unsigned int); extern void bitmap_set_range (bitmap, unsigned int, unsigned int);
extern bool bitmap_ior (bitmap, bitmap, bitmap); extern bool bitmap_ior (bitmap, const_bitmap, const_bitmap);
extern bool bitmap_ior_into (bitmap, bitmap); extern bool bitmap_ior_into (bitmap, const_bitmap);
extern void bitmap_xor (bitmap, bitmap, bitmap); extern void bitmap_xor (bitmap, const_bitmap, const_bitmap);
extern void bitmap_xor_into (bitmap, bitmap); extern void bitmap_xor_into (bitmap, const_bitmap);
/* DST = A | (B & ~C). Return true if DST changes. */ /* DST = A | (B & ~C). Return true if DST changes. */
extern bool bitmap_ior_and_compl (bitmap DST, bitmap A, bitmap B, bitmap C); extern bool bitmap_ior_and_compl (bitmap DST, const_bitmap A, const_bitmap B, const_bitmap C);
/* A |= (B & ~C). Return true if A changes. */ /* A |= (B & ~C). Return true if A changes. */
extern bool bitmap_ior_and_compl_into (bitmap DST, bitmap B, bitmap C); extern bool bitmap_ior_and_compl_into (bitmap DST, const_bitmap B, const_bitmap C);
/* Clear a single register in a register set. */ /* Clear a single register in a register set. */
extern void bitmap_clear_bit (bitmap, int); extern void bitmap_clear_bit (bitmap, int);
...@@ -143,11 +143,11 @@ extern void bitmap_set_bit (bitmap, int); ...@@ -143,11 +143,11 @@ extern void bitmap_set_bit (bitmap, int);
extern int bitmap_bit_p (bitmap, int); extern int bitmap_bit_p (bitmap, int);
/* Debug functions to print a bitmap linked list. */ /* Debug functions to print a bitmap linked list. */
extern void debug_bitmap (bitmap); extern void debug_bitmap (const_bitmap);
extern void debug_bitmap_file (FILE *, bitmap); extern void debug_bitmap_file (FILE *, const_bitmap);
/* Print a bitmap. */ /* Print a bitmap. */
extern void bitmap_print (FILE *, bitmap, const char *, const char *); extern void bitmap_print (FILE *, const_bitmap, const char *, const char *);
/* Initialize and release a bitmap obstack. */ /* Initialize and release a bitmap obstack. */
extern void bitmap_obstack_initialize (bitmap_obstack *); extern void bitmap_obstack_initialize (bitmap_obstack *);
...@@ -179,10 +179,10 @@ extern void bitmap_obstack_free (bitmap); ...@@ -179,10 +179,10 @@ extern void bitmap_obstack_free (bitmap);
/* A few compatibility/functions macros for compatibility with sbitmaps */ /* A few compatibility/functions macros for compatibility with sbitmaps */
#define dump_bitmap(file, bitmap) bitmap_print (file, bitmap, "", "\n") #define dump_bitmap(file, bitmap) bitmap_print (file, bitmap, "", "\n")
#define bitmap_zero(a) bitmap_clear (a) #define bitmap_zero(a) bitmap_clear (a)
extern unsigned bitmap_first_set_bit (bitmap); extern unsigned bitmap_first_set_bit (const_bitmap);
/* Compute bitmap hash (for purposes of hashing etc.) */ /* Compute bitmap hash (for purposes of hashing etc.) */
extern hashval_t bitmap_hash(bitmap); extern hashval_t bitmap_hash(const_bitmap);
/* Allocate a bitmap from a bit obstack. */ /* Allocate a bitmap from a bit obstack. */
#define BITMAP_ALLOC(OBSTACK) bitmap_obstack_alloc (OBSTACK) #define BITMAP_ALLOC(OBSTACK) bitmap_obstack_alloc (OBSTACK)
...@@ -217,7 +217,7 @@ typedef struct ...@@ -217,7 +217,7 @@ typedef struct
iterate from. */ iterate from. */
static inline void static inline void
bmp_iter_set_init (bitmap_iterator *bi, bitmap map, bmp_iter_set_init (bitmap_iterator *bi, const_bitmap map,
unsigned start_bit, unsigned *bit_no) unsigned start_bit, unsigned *bit_no)
{ {
bi->elt1 = map->first; bi->elt1 = map->first;
...@@ -259,7 +259,7 @@ bmp_iter_set_init (bitmap_iterator *bi, bitmap map, ...@@ -259,7 +259,7 @@ bmp_iter_set_init (bitmap_iterator *bi, bitmap map,
bitmaps. START_BIT is the bit to commence from. */ bitmaps. START_BIT is the bit to commence from. */
static inline void static inline void
bmp_iter_and_init (bitmap_iterator *bi, bitmap map1, bitmap map2, bmp_iter_and_init (bitmap_iterator *bi, const_bitmap map1, const_bitmap map2,
unsigned start_bit, unsigned *bit_no) unsigned start_bit, unsigned *bit_no)
{ {
bi->elt1 = map1->first; bi->elt1 = map1->first;
...@@ -327,7 +327,7 @@ bmp_iter_and_init (bitmap_iterator *bi, bitmap map1, bitmap map2, ...@@ -327,7 +327,7 @@ bmp_iter_and_init (bitmap_iterator *bi, bitmap map1, bitmap map2,
*/ */
static inline void static inline void
bmp_iter_and_compl_init (bitmap_iterator *bi, bitmap map1, bitmap map2, bmp_iter_and_compl_init (bitmap_iterator *bi, const_bitmap map1, const_bitmap map2,
unsigned start_bit, unsigned *bit_no) unsigned start_bit, unsigned *bit_no)
{ {
bi->elt1 = map1->first; bi->elt1 = map1->first;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment