aboutsummaryrefslogtreecommitdiff
path: root/lib/bitset.h
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2022-01-28 13:56:35 -0800
committerDan Willemsen <dwillemsen@google.com>2022-03-24 00:01:44 -0700
commit3c11d492c628c550156ff095a8e1ef9795bf8ee4 (patch)
treea9ba48bb4280046e5b80bb98277c69f9d66c74b6 /lib/bitset.h
parent1d564b426399292021bf521360ef40451367a4ce (diff)
downloadbison-3c11d492c628c550156ff095a8e1ef9795bf8ee4.tar.gz
Upgrade to bison 3.8.2
This just replaces all the files with the 3.8.2 tarball contents and restores the handful of android-specific files. It also updates the METADATA file. The (linux_glibc|linux_musl|darwin)-lib/... directories and Android.bp file will be updated in a future set of changes. Test: treehugger Change-Id: I406c5d49edae31e412d1676ad69f9acd8a6ba8a6
Diffstat (limited to 'lib/bitset.h')
-rw-r--r--lib/bitset.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/lib/bitset.h b/lib/bitset.h
index ea04916e..abbfdd1b 100644
--- a/lib/bitset.h
+++ b/lib/bitset.h
@@ -1,6 +1,6 @@
/* Generic bitsets.
- Copyright (C) 2002-2004, 2009-2015, 2018-2019 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004, 2009-2015, 2018-2021 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
@@ -96,6 +96,9 @@ typedef struct
} bitset_iterator;
+/* Free bitset. Do nothing if NULL. */
+void bitset_free (bitset);
+
/* Return bytes required for bitset of desired type and size. */
size_t bitset_bytes (enum bitset_type, bitset_bindex);
@@ -107,21 +110,21 @@ bitset bitset_init (bitset, bitset_bindex, enum bitset_type);
enum bitset_type bitset_type_choose (bitset_bindex, bitset_attrs);
/* Create a bitset of desired type and size. The bitset is zeroed. */
-bitset bitset_alloc (bitset_bindex, enum bitset_type);
+bitset bitset_alloc (bitset_bindex, enum bitset_type)
+ _GL_ATTRIBUTE_DEALLOC (bitset_free, 1);
-/* Free bitset. Do nothing if NULL. */
-void bitset_free (bitset);
+/* Free bitset allocated on obstack. Do nothing if NULL. */
+void bitset_obstack_free (bitset);
/* Create a bitset of desired type and size using an obstack. The
bitset is zeroed. */
bitset bitset_obstack_alloc (struct obstack *bobstack,
- bitset_bindex, enum bitset_type);
-
-/* Free bitset allocated on obstack. Do nothing if NULL. */
-void bitset_obstack_free (bitset);
+ bitset_bindex, enum bitset_type)
+ _GL_ATTRIBUTE_DEALLOC (bitset_obstack_free, 1);
/* Create a bitset of desired size and attributes. The bitset is zeroed. */
-bitset bitset_create (bitset_bindex, bitset_attrs);
+bitset bitset_create (bitset_bindex, bitset_attrs)
+ _GL_ATTRIBUTE_DEALLOC (bitset_free, 1);
/* Return bitset type. */
enum bitset_type bitset_type_get (bitset);
@@ -282,17 +285,21 @@ bitset_test (bitset bset, bitset_bindex bitno)
/* Return true if both bitsets are of the same type and size. */
bool bitset_compatible_p (bitset bset1, bitset bset2);
-/* Find next set bit from the given bit index. */
-bitset_bindex bitset_next (bitset, bitset_bindex);
+/* Find next bit set in SRC starting from and including BITNO.
+ Return BITSET_BINDEX_MAX if SRC empty. */
+bitset_bindex bitset_next (bitset src, bitset_bindex bitno);
-/* Find previous set bit from the given bit index. */
-bitset_bindex bitset_prev (bitset, bitset_bindex);
+/* Find previous bit set in SRC starting from and including BITNO.
+ Return BITSET_BINDEX_MAX if SRC empty. */
+bitset_bindex bitset_prev (bitset src, bitset_bindex bitno);
-/* Find first set bit. */
-bitset_bindex bitset_first (bitset);
+/* Find first set bit.
+ Return BITSET_BINDEX_MAX if SRC empty. */
+bitset_bindex bitset_first (bitset src);
-/* Find last set bit. */
-bitset_bindex bitset_last (bitset);
+/* Find last set bit.
+ Return BITSET_BINDEX_MAX if SRC empty. */
+bitset_bindex bitset_last (bitset src);
/* Return nonzero if this is the only set bit. */
bool bitset_only_set_p (bitset, bitset_bindex);