12#ifndef COREBITVECTOR_H_
13#define COREBITVECTOR_H_
33 typedef unsigned long long Word;
60 bool empty(
void)
const;
113 size_t hash(
void)
const;
184 bool atEnd(
void)
const;
190 std::vector<Word>::const_iterator
wordIt;
const CoreBitVectorIterator & operator++(void)
Pre-increment: ++it.
const CoreBitVector * cbv
CoreBitVector we are iterating over.
std::vector< Word >::const_iterator wordIt
Word in words we are looking at.
std::forward_iterator_tag iterator_category
CoreBitVectorIterator & operator=(const CoreBitVectorIterator &cbv)=default
CoreBitVectorIterator & operator=(CoreBitVectorIterator &&cbv)=default
CoreBitVectorIterator(const CoreBitVectorIterator &cbv)=default
bool operator==(const CoreBitVectorIterator &rhs) const
Equality: *this == rhs.
CoreBitVectorIterator(void)=delete
CoreBitVectorIterator(CoreBitVectorIterator &&cbv)=default
std::ptrdiff_t difference_type
bool operator!=(const CoreBitVectorIterator &rhs) const
Inequality: *this != rhs.
u32_t operator*(void) const
Dereference: *it.
size_t nextSetIndex(const size_t start) const
bool operator==(const CoreBitVector &rhs) const
Returns true if this CBV and rhs have the same bits set.
bool intersects(const CoreBitVector &rhs) const
Returns true if this CBV and rhs share any set bits.
u32_t firstCommonBit(const CoreBitVector &rhs) const
Returns the first bit position that both this CBV and rhs can hold.
void clear(void)
Empty the CBV.
bool test_and_set(u32_t bit)
CoreBitVector & operator=(const CoreBitVector &rhs)
Copy assignment.
bool canHold(u32_t bit) const
Returns true if bit can fit in this CBV without resizing.
void reset(u32_t bit)
Resets bit in the CBV.
CoreBitVectorIterator const_iterator
void set(u32_t bit)
Sets bit in the CBV.
bool operator-=(const CoreBitVector &rhs)
void extendForward(u32_t bit)
Add enough words (append) to be able to include bit.
static const size_t WordSize
bool operator&=(const CoreBitVector &rhs)
void extendTo(u32_t bit)
Add enough words (append xor prepend) to be able to include bit.
u32_t offset
The first bit of the first word.
bool test(u32_t bit) const
Returns true if bit is set in this CBV.
std::vector< Word > words
Our actual bit vector.
const_iterator begin(void) const
u32_t finalBit(void) const
Returns the last bit that this CBV can hold.
bool intersectWithComplement(const CoreBitVector &rhs)
const_iterator end(void) const
bool empty(void) const
Returns true if no bits are set.
void extendBackward(u32_t bit)
Add enough words (prepend) to be able to include bit.
u32_t count(void) const
Returns number of bits set.
size_t indexForBit(u32_t bit) const
Returns the index into words which would hold bit.
CoreBitVector(void)
Construct empty CBV.
bool contains(const CoreBitVector &rhs) const
Returns true if this CBV is a superset of rhs.
bool operator!=(const CoreBitVector &rhs) const
Returns true if either this CBV or rhs has a bit set unique to the other.
bool operator|=(const CoreBitVector &rhs)
size_t hash(void) const
Hash for this CBV.
llvm::IRBuilder IRBuilder
size_t operator()(const CoreBitVector &cbv) const
provide extra hash function for std::pair handling