From 5b85eca02c4414a007d566cd0c673bcb918b468a Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 19 Mar 2009 14:00:05 +0000 Subject: [PATCH] - add rbitset_set_all() [r25702] --- include/libfirm/adt/raw_bitset.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/libfirm/adt/raw_bitset.h b/include/libfirm/adt/raw_bitset.h index f14bf85e3..64601507b 100644 --- a/include/libfirm/adt/raw_bitset.h +++ b/include/libfirm/adt/raw_bitset.h @@ -159,6 +159,18 @@ static inline void rbitset_set(unsigned *bitset, unsigned pos) { BITSET_ELEM(bitset,pos) |= 1 << (pos % BITS_PER_ELEM); } +/** + * Set all bits in a given bitset. + * + * @param bitset the bitset + * @param size number of bits in the bitset + */ +static inline void rbitset_set_all(unsigned *bitset, unsigned size) { + unsigned size_bytes = BITSET_SIZE_BYTES(size); + memset(bitset, ~0, size_bytes); +} + + /** * Clear a bit at position pos. * -- 2.20.1