- add rbitset_set_all()
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 19 Mar 2009 14:00:05 +0000 (14:00 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 19 Mar 2009 14:00:05 +0000 (14:00 +0000)
[r25702]

include/libfirm/adt/raw_bitset.h

index f14bf85..6460150 100644 (file)
@@ -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.
  *