/* Sparse array based bitmaps.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
+Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
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, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
#ifndef GCC_EBITMAP_H
#define GCC_EBITMAP_H
#define EBITMAP_ELT_TYPE unsigned HOST_WIDEST_FAST_INT
typedef struct ebitmap_def
-{
+{
unsigned int n_elts; /* number of elements in the array. */
sbitmap wordmask; /* wordmask saying which words are
nonzero. */
extern void ebitmap_clear (ebitmap);
extern int ebitmap_last_set_bit (ebitmap);
extern void debug_ebitmap (ebitmap);
-extern void dump_ebitmap (FILE *, ebitmap);
extern unsigned long ebitmap_popcount(ebitmap, unsigned long);
/* The iterator for ebitmap. */
/* The word mask iterator. */
sbitmap_iterator maskiter;
} ebitmap_iterator;
-
+
static inline void
ebitmap_iter_init (ebitmap_iterator *i, ebitmap bmp, unsigned int min)
{
- sbitmap_iter_init (&i->maskiter, bmp->wordmask,
+ sbitmap_iter_init (&i->maskiter, bmp->wordmask,
min / EBITMAP_ELT_BITS);
i->size = bmp->numwords;
if (i->size == 0)
- return;
+ {
+ i->ptr = NULL;
+ i->eltnum = 0;
+ i->bit_num = 0;
+ i->word = 0;
+ return;
+ }
i->ptr = bmp->elts;
i->bit_num = min;
i->eltnum = 0;
static inline bool
ebitmap_iter_cond (ebitmap_iterator *i, unsigned int *n)
{
- unsigned int ourn;
+ unsigned int ourn = 0;
if (i->size == 0)
return false;