class SmallBitVector
Declaration
class SmallBitVector { /* full declaration omitted */ };
Description
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is small. It contains one pointer-sized field, which is directly used as a plain collection of bits when possible, or as a pointer to a larger heap-allocated array when necessary. This allows normal "small" cases to be fast without losing generality for large inputs.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:34
Method Overview
- public SmallBitVector(unsigned int s, bool t = false)
- public SmallBitVector(const llvm::SmallBitVector & RHS)
- public SmallBitVector(llvm::SmallBitVector && RHS)
- public SmallBitVector()
- public bool all() const
- public bool any() const
- public bool anyCommon(const llvm::SmallBitVector & RHS) const
- public void clear()
- public void clearBitsInMask(const uint32_t * Mask, unsigned int MaskWords = ~0U)
- public void clearBitsNotInMask(const uint32_t * Mask, unsigned int MaskWords = ~0U)
- public llvm::SmallBitVector::size_type count() const
- public bool empty() const
- public int find_first() const
- public int find_first_unset() const
- public int find_last() const
- public int find_last_unset() const
- public int find_next(unsigned int Prev) const
- public int find_next_unset(unsigned int Prev) const
- public int find_prev(unsigned int PriorTo) const
- public llvm::SmallBitVector & flip(unsigned int Idx)
- public llvm::SmallBitVector & flip()
- public bool isSmall() const
- public bool none() const
- public void push_back(bool Val)
- public void reserve(unsigned int N)
- public llvm::SmallBitVector & reset(const llvm::SmallBitVector & RHS)
- public llvm::SmallBitVector & reset()
- public llvm::SmallBitVector & reset(unsigned int Idx)
- public llvm::SmallBitVector & reset(unsigned int I, unsigned int E)
- public void resize(unsigned int N, bool t = false)
- public llvm::SmallBitVector & set(unsigned int Idx)
- public llvm::SmallBitVector & set(unsigned int I, unsigned int E)
- public llvm::SmallBitVector & set()
- public void setBitsInMask(const uint32_t * Mask, unsigned int MaskWords = ~0U)
- public void setBitsNotInMask(const uint32_t * Mask, unsigned int MaskWords = ~0U)
- public iterator_range<llvm::SmallBitVector::const_set_bits_iterator> set_bits() const
- public llvm::SmallBitVector::const_set_bits_iterator set_bits_begin() const
- public llvm::SmallBitVector::const_set_bits_iterator set_bits_end() const
- public size_t size() const
- public void swap(llvm::SmallBitVector & RHS)
- public bool test(unsigned int Idx) const
- public bool test(const llvm::SmallBitVector & RHS) const
- public ~SmallBitVector()
Methods
¶SmallBitVector(unsigned int s, bool t = false)
SmallBitVector(unsigned int s, bool t = false)
Description
Creates a bitvector of specified number of bits. All bits are initialized to the specified value.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:145
Parameters
- unsigned int s
- bool t = false
¶SmallBitVector(const llvm::SmallBitVector& RHS)
SmallBitVector(const llvm::SmallBitVector& RHS)
Description
SmallBitVector copy ctor.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:153
Parameters
- const llvm::SmallBitVector& RHS
¶SmallBitVector(llvm::SmallBitVector&& RHS)
SmallBitVector(llvm::SmallBitVector&& RHS)
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:160
Parameters
- llvm::SmallBitVector&& RHS
¶SmallBitVector()
SmallBitVector()
Description
Creates an empty bitvector.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:141
¶bool all() const
bool all() const
Description
Returns true if all bits are set.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:213
¶bool any() const
bool any() const
Description
Returns true if any bit is set.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:206
¶bool anyCommon(
const llvm::SmallBitVector& RHS) const
bool anyCommon(
const llvm::SmallBitVector& RHS) const
Description
Test if any common bits are set.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:473
Parameters
- const llvm::SmallBitVector& RHS
¶void clear()
void clear()
Description
Clear all bits.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:322
¶void clearBitsInMask(const uint32_t* Mask,
unsigned int MaskWords = ~0U)
void clearBitsInMask(const uint32_t* Mask,
unsigned int MaskWords = ~0U)
Description
Clear any bits in this vector that are set in Mask. Don't resize. This computes "*this &= ~Mask".
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:640
Parameters
- const uint32_t* Mask
- unsigned int MaskWords = ~0U
¶void clearBitsNotInMask(
const uint32_t* Mask,
unsigned int MaskWords = ~0U)
void clearBitsNotInMask(
const uint32_t* Mask,
unsigned int MaskWords = ~0U)
Description
Clear a bit in this vector for every '0' bit in Mask. Don't resize. This computes "*this &= Mask".
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:658
Parameters
- const uint32_t* Mask
- unsigned int MaskWords = ~0U
¶llvm::SmallBitVector::size_type count() const
llvm::SmallBitVector::size_type count() const
Description
Returns the number of bits which are set.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:197
¶bool empty() const
bool empty() const
Description
Tests whether there are no bits in this bitvector.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:187
¶int find_first() const
int find_first() const
Description
Returns the index of the first set bit, -1 if none of the bits are set.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:227
¶int find_first_unset() const
int find_first_unset() const
Description
Returns the index of the first unset bit, -1 if all of the bits are set.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:248
¶int find_last() const
int find_last() const
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:237
¶int find_last_unset() const
int find_last_unset() const
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:259
¶int find_next(unsigned int Prev) const
int find_next(unsigned int Prev) const
Description
Returns the index of the next set bit following the "Prev" bit. Returns -1 if the next set bit is not found.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:274
Parameters
- unsigned int Prev
¶int find_next_unset(unsigned int Prev) const
int find_next_unset(unsigned int Prev) const
Description
Returns the index of the next unset bit following the "Prev" bit. Returns -1 if the next unset bit is not found.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:288
Parameters
- unsigned int Prev
¶int find_prev(unsigned int PriorTo) const
int find_prev(unsigned int PriorTo) const
Description
find_prev - Returns the index of the first set bit that precedes the the bit at \p PriorTo. Returns -1 if all previous bits are unset.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:305
Parameters
- unsigned int PriorTo
¶llvm::SmallBitVector& flip(unsigned int Idx)
llvm::SmallBitVector& flip(unsigned int Idx)
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:437
Parameters
- unsigned int Idx
¶llvm::SmallBitVector& flip()
llvm::SmallBitVector& flip()
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:429
¶bool isSmall() const
bool isSmall() const
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:184
¶bool none() const
bool none() const
Description
Returns true if none of the bits are set.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:220
¶void push_back(bool Val)
void push_back(bool Val)
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:468
Parameters
- bool Val
¶void reserve(unsigned int N)
void reserve(unsigned int N)
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:345
Parameters
- unsigned int N
¶llvm::SmallBitVector& reset(
const llvm::SmallBitVector& RHS)
llvm::SmallBitVector& reset(
const llvm::SmallBitVector& RHS)
Description
Reset bits that are set in RHS. Same as *this & = ~RHS.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:525
Parameters
- const llvm::SmallBitVector& RHS
¶llvm::SmallBitVector& reset()
llvm::SmallBitVector& reset()
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:398
¶llvm::SmallBitVector& reset(unsigned int Idx)
llvm::SmallBitVector& reset(unsigned int Idx)
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:406
Parameters
- unsigned int Idx
¶llvm::SmallBitVector& reset(unsigned int I,
unsigned int E)
llvm::SmallBitVector& reset(unsigned int I,
unsigned int E)
Description
Efficiently reset a range of bits in [I, E)
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:415
Parameters
- unsigned int I
- unsigned int E
¶void resize(unsigned int N, bool t = false)
void resize(unsigned int N, bool t = false)
Description
Grow or shrink the bitvector.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:329
Parameters
- unsigned int N
- bool t = false
¶llvm::SmallBitVector& set(unsigned int Idx)
llvm::SmallBitVector& set(unsigned int Idx)
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:371
Parameters
- unsigned int Idx
¶llvm::SmallBitVector& set(unsigned int I,
unsigned int E)
llvm::SmallBitVector& set(unsigned int I,
unsigned int E)
Description
Efficiently set a range of bits in [I, E)
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:384
Parameters
- unsigned int I
- unsigned int E
¶llvm::SmallBitVector& set()
llvm::SmallBitVector& set()
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:363
¶void setBitsInMask(const uint32_t* Mask,
unsigned int MaskWords = ~0U)
void setBitsInMask(const uint32_t* Mask,
unsigned int MaskWords = ~0U)
Description
Add '1' bits from Mask to this vector. Don't resize. This computes "*this |= Mask".
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:631
Parameters
- const uint32_t* Mask
- unsigned int MaskWords = ~0U
¶void setBitsNotInMask(
const uint32_t* Mask,
unsigned int MaskWords = ~0U)
void setBitsNotInMask(
const uint32_t* Mask,
unsigned int MaskWords = ~0U)
Description
Add a bit to this vector for every '0' bit in Mask. Don't resize. This computes "*this |= ~Mask".
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:649
Parameters
- const uint32_t* Mask
- unsigned int MaskWords = ~0U
¶iterator_range<
llvm::SmallBitVector::const_set_bits_iterator>
set_bits() const
iterator_range<
llvm::SmallBitVector::const_set_bits_iterator>
set_bits() const
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:180
¶llvm::SmallBitVector::const_set_bits_iterator
set_bits_begin() const
llvm::SmallBitVector::const_set_bits_iterator
set_bits_begin() const
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:172
¶llvm::SmallBitVector::const_set_bits_iterator
set_bits_end() const
llvm::SmallBitVector::const_set_bits_iterator
set_bits_end() const
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:176
¶size_t size() const
size_t size() const
Description
Returns the number of bits in this bitvector.
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:192
¶void swap(llvm::SmallBitVector& RHS)
void swap(llvm::SmallBitVector& RHS)
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:625
Parameters
- llvm::SmallBitVector& RHS
¶bool test(unsigned int Idx) const
bool test(unsigned int Idx) const
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:463
Parameters
- unsigned int Idx
¶bool test(const llvm::SmallBitVector& RHS) const
bool test(const llvm::SmallBitVector& RHS) const
Description
Check if (This - RHS) is zero. This is the same as reset(RHS) and any().
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:539
Parameters
- const llvm::SmallBitVector& RHS
¶~SmallBitVector()
~SmallBitVector()
Declared at: llvm/include/llvm/ADT/SmallBitVector.h:164