diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-11-11 10:36:27 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-11-11 10:36:27 +0000 |
commit | 65a6f342653e7421f481f5dc3c79960edfd9599f (patch) | |
tree | fd9d98f746f7a704c24f4125bc04202bcd0f7463 /gcc/bitmap.h | |
parent | af2a91bdce85a4bf9a5a1283b10e08e6cb3d7ae3 (diff) | |
download | gcc-65a6f342653e7421f481f5dc3c79960edfd9599f.zip gcc-65a6f342653e7421f481f5dc3c79960edfd9599f.tar.gz gcc-65a6f342653e7421f481f5dc3c79960edfd9599f.tar.bz2 |
bitmap.h (nBITMAP_WORD_BITS): Remove.
* bitmap.h (nBITMAP_WORD_BITS): Remove.
(BITMAP_WORD_BITS): Force unsigned by use of 1u.
(BITMAP_ELEMENT_WORDS, BITMAP_ELEMENT_ALL_BITS): Remove
unnecessary casts.
(bitmap_first_set_bit): Return unsigned, use ctzl.
(bitmap_last_set_bit): Remove.
* bitmap.c (bitmap_element_zerop, bitmap_copy): Make iterator
unsigned.
(bitmap_first_set_bit): Return unsigned, require non-empty bitmap,
remove special case code for two word elements.
(bitmap_last_set_bit): Remove.
* ra-build.c (livethrough_conflicts_bb): Replace unnecessary use of
bitmap_first_set_bit with bitmap_empty_p.
* tree-outof-ssa.c (analyze_edges_for_bb): Likewise.
* tree-ssa-pre.c (bitmap_print_value): Use simple flag rather than
bitmap_last_bit_set.
From-SVN: r90478
Diffstat (limited to 'gcc/bitmap.h')
-rw-r--r-- | gcc/bitmap.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/gcc/bitmap.h b/gcc/bitmap.h index 7bf6efe..8732c34 100644 --- a/gcc/bitmap.h +++ b/gcc/bitmap.h @@ -24,24 +24,20 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* Fundamental storage type for bitmap. */ -/* typedef unsigned HOST_WIDE_INT BITMAP_WORD; */ -/* #define nBITMAP_WORD_BITS HOST_BITS_PER_WIDE_INT */ typedef unsigned long BITMAP_WORD; -#define nBITMAP_WORD_BITS (CHAR_BIT * SIZEOF_LONG) -#define BITMAP_WORD_BITS (unsigned) nBITMAP_WORD_BITS +/* BITMAP_WORD_BITS needs to be unsigned, but cannot contain casts as + it is used in preprocessor directives -- hence the 1u. */ +#define BITMAP_WORD_BITS (CHAR_BIT * SIZEOF_LONG * 1u) /* Number of words to use for each element in the linked list. */ #ifndef BITMAP_ELEMENT_WORDS -#define BITMAP_ELEMENT_WORDS ((128 + nBITMAP_WORD_BITS - 1) / nBITMAP_WORD_BITS) +#define BITMAP_ELEMENT_WORDS ((128 + BITMAP_WORD_BITS - 1) / BITMAP_WORD_BITS) #endif -/* Number of bits in each actual element of a bitmap. We get slightly better - code for bit % BITMAP_ELEMENT_ALL_BITS and bit / BITMAP_ELEMENT_ALL_BITS if - bits is unsigned, assuming it is a power of 2. */ +/* Number of bits in each actual element of a bitmap. */ -#define BITMAP_ELEMENT_ALL_BITS \ - ((unsigned) (BITMAP_ELEMENT_WORDS * BITMAP_WORD_BITS)) +#define BITMAP_ELEMENT_ALL_BITS (BITMAP_ELEMENT_WORDS * BITMAP_WORD_BITS) /* Bitmap set element. We use a linked list to hold only the bits that are set. This allows for use to grow the bitset dynamically without @@ -132,8 +128,7 @@ extern void bitmap_release_memory (void); /* A few compatibility/functions macros for compatibility with sbitmaps */ #define dump_bitmap(file, bitmap) bitmap_print (file, bitmap, "", "\n") #define bitmap_zero(a) bitmap_clear (a) -extern int bitmap_first_set_bit (bitmap); -extern int bitmap_last_set_bit (bitmap); +extern unsigned bitmap_first_set_bit (bitmap); /* Allocate a bitmap with oballoc. */ #define BITMAP_OBSTACK_ALLOC(OBSTACK) \ |