aboutsummaryrefslogtreecommitdiff
path: root/gcc/sbitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/sbitmap.c')
-rw-r--r--gcc/sbitmap.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index a25bff4b..65a4686 100644
--- a/gcc/sbitmap.c
+++ b/gcc/sbitmap.c
@@ -1,5 +1,6 @@
/* Simple bitmaps.
- Copyright (C) 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003, 2004, 2006, 2007
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -262,6 +263,19 @@ sbitmap_equal (sbitmap a, sbitmap b)
return !memcmp (a->elms, b->elms, sizeof (SBITMAP_ELT_TYPE) * a->size);
}
+/* Return true if the bitmap is empty. */
+
+bool
+sbitmap_empty_p (sbitmap bmap)
+{
+ unsigned int i;
+ for (i=0; i<bmap->size; i++)
+ if (bmap->elms[i])
+ return false;
+
+ return true;
+}
+
/* Zero all elements in a bitmap. */
void