X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fbitmap.h;h=216616d0b79e04792184b31abec755ecdd0be314;hb=94c1bb0d425f7e7b9bd49f06621b198c4e94a804;hp=beb59d85f8602b3bbafe2e3848c2c5d8aab20c9a;hpb=5c9adf2ab9dd71fd0b3f887c24789157cec496e7;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/bitmap.h b/gcc/bitmap.h index beb59d85f86..216616d0b79 100644 --- a/gcc/bitmap.h +++ b/gcc/bitmap.h @@ -1,5 +1,5 @@ /* Functions to support general ended bitmaps. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ #ifndef GCC_BITMAP_H #define GCC_BITMAP_H @@ -49,8 +49,15 @@ typedef struct bitmap_obstack GTY (()) /* 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 - having to realloc and copy a giant bit array. The `prev' field is - undefined for an element on the free list. */ + having to realloc and copy a giant bit array. + + The free list is implemented as a list of lists. There is one + outer list connected together by prev fields. Each element of that + outer is an inner list (that may consist only of the outer list + element) that are connected by the next fields. The prev pointer + is undefined for interior elements. This allows + bitmap_elt_clear_from to be implemented in unit time rather than + linear in the number of elements to be freed. */ typedef struct bitmap_element_def GTY(()) { @@ -70,8 +77,6 @@ typedef struct bitmap_head_def GTY(()) { } bitmap_head; -typedef struct bitmap_head_def *bitmap; - /* Global data */ extern bitmap_element bitmap_zero_bits; /* Zero bitmap element */ extern bitmap_obstack bitmap_default_obstack; /* Default bitmap obstack */ @@ -95,6 +100,9 @@ extern bool bitmap_intersect_compl_p (bitmap, bitmap); /* True if MAP is an empty bitmap. */ #define bitmap_empty_p(MAP) (!(MAP)->first) +/* Count the number of bits set in the bitmap. */ +extern unsigned long bitmap_count_bits (bitmap); + /* Boolean operations on bitmaps. The _into variants are two operand versions that modify the first source operand. The other variants are three operand versions that to not destroy the source bitmaps. @@ -102,7 +110,10 @@ extern bool bitmap_intersect_compl_p (bitmap, bitmap); extern void bitmap_and (bitmap, bitmap, bitmap); extern void bitmap_and_into (bitmap, bitmap); extern void bitmap_and_compl (bitmap, bitmap, bitmap); -extern void bitmap_and_compl_into (bitmap, bitmap); +extern bool bitmap_and_compl_into (bitmap, bitmap); +#define bitmap_compl_and(DST, A, B) bitmap_and_compl (DST, B, A) +extern void bitmap_compl_and_into (bitmap, bitmap); +extern void bitmap_clear_range (bitmap, unsigned int, unsigned int); extern bool bitmap_ior (bitmap, bitmap, bitmap); extern bool bitmap_ior_into (bitmap, bitmap); extern void bitmap_xor (bitmap, bitmap, bitmap); @@ -129,7 +140,7 @@ extern void debug_bitmap_file (FILE *, bitmap); /* Print a bitmap. */ extern void bitmap_print (FILE *, bitmap, const char *, const char *); -/* Initialize and releas a bitmap obstack. */ +/* Initialize and release a bitmap obstack. */ extern void bitmap_obstack_initialize (bitmap_obstack *); extern void bitmap_obstack_release (bitmap_obstack *); @@ -159,16 +170,10 @@ extern unsigned bitmap_first_set_bit (bitmap); /* Allocate a gc'd bitmap. */ #define BITMAP_GGC_ALLOC() bitmap_gc_alloc () -/* Allocate a bitmap with xmalloc. */ -#define BITMAP_XMALLOC() BITMAP_ALLOC (NULL) - /* Do any cleanup needed on a bitmap when it is no longer used. */ #define BITMAP_FREE(BITMAP) \ ((void)(bitmap_obstack_free (BITMAP), (BITMAP) = NULL)) -/* Do any cleanup needed on an xmalloced bitmap when it is no longer used. */ -#define BITMAP_XFREE(BITMAP) BITMAP_FREE (BITMAP) - /* Iterator for bitmaps. */ typedef struct