class BitVector
Declaration
class BitVector { /* full declaration omitted */ };
Declared at: llvm/include/llvm/ADT/BitVector.h:75
Member Variables
- private llvm::BitVector::Storage Bits
- private unsigned int Size = 0
Method Overview
- public BitVector()
- public BitVector(unsigned int s, bool t = false)
- private unsigned int NumBitWords(unsigned int S) const
- public bool all() const
- public bool any() const
- public bool anyCommon(const llvm::BitVector & RHS) const
- public template <class F, class... ArgTys>static llvm::BitVector & apply(F && f, llvm::BitVector & Out, const llvm::BitVector & Arg, const ArgTys &... Args)
- private template <bool AddBits, bool InvertMask>void applyMask(const uint32_t * Mask, unsigned int MaskWords)
- public bool back() 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)
- private void clear_unused_bits()
- public llvm::BitVector::size_type count() const
- public bool empty() const
- public int find_first() const
- public int find_first_in(unsigned int Begin, unsigned int End, bool Set = true) const
- public int find_first_unset() const
- public int find_first_unset_in(unsigned int Begin, unsigned int End) const
- public int find_last() const
- public int find_last_in(unsigned int Begin, unsigned int End) const
- public int find_last_unset() const
- public int find_last_unset_in(unsigned int Begin, unsigned int End) 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 int find_prev_unset(unsigned int PriorTo)
- public llvm::BitVector & flip()
- public llvm::BitVector & flip(unsigned int Idx)
- public llvm::BitVector::size_type getBitCapacity() const
- public ArrayRef<llvm::BitVector::BitWord> getData() const
- public llvm::BitVector::size_type getMemorySize() const
- private void init_words(bool t)
- public void invalid()
- public bool isInvalid() const
- private int next_unset_in_word(int WordIndex, llvm::BitVector::BitWord Word) const
- public bool none() const
- public void pop_back()
- public void push_back(bool Val)
- public void reserve(unsigned int N)
- public llvm::BitVector & reset(unsigned int Idx)
- public llvm::BitVector & reset(const llvm::BitVector & RHS)
- public llvm::BitVector & reset(unsigned int I, unsigned int E)
- public llvm::BitVector & reset()
- public void resize(unsigned int N, bool t = false)
- public llvm::BitVector & set(unsigned int I, unsigned int E)
- public llvm::BitVector & set(unsigned int Idx)
- public llvm::BitVector & 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::BitVector::const_set_bits_iterator> set_bits() const
- public llvm::BitVector::const_set_bits_iterator set_bits_begin() const
- public llvm::BitVector::const_set_bits_iterator set_bits_end() const
- private void set_unused_bits(bool t = true)
- public llvm::BitVector::size_type size() const
- public void swap(llvm::BitVector & RHS)
- public bool test(const llvm::BitVector & RHS) const
- public bool test(unsigned int Idx) const
- private void wordShl(uint32_t Count)
- private void wordShr(uint32_t Count)
Methods
¶BitVector()
BitVector()
Description
BitVector default ctor - Creates an empty bitvector.
Declared at: llvm/include/llvm/ADT/BitVector.h:138
¶BitVector(unsigned int s, bool t = false)
BitVector(unsigned int s, bool t = false)
Description
BitVector ctor - Creates a bitvector of specified number of bits. All bits are initialized to the specified value.
Declared at: llvm/include/llvm/ADT/BitVector.h:142
Parameters
- unsigned int s
- bool t = false
¶unsigned int NumBitWords(unsigned int S) const
unsigned int NumBitWords(unsigned int S) const
Declared at: llvm/include/llvm/ADT/BitVector.h:770
Parameters
- unsigned int S
¶bool all() const
bool all() const
Description
all - Returns true if all bits are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:168
¶bool any() const
bool any() const
Description
any - Returns true if any bit is set.
Declared at: llvm/include/llvm/ADT/BitVector.h:163
¶bool anyCommon(const llvm::BitVector& RHS) const
bool anyCommon(const llvm::BitVector& RHS) const
Description
Test if any common bits are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:482
Parameters
- const llvm::BitVector& RHS
¶template <class F, class... ArgTys>
static llvm::BitVector& apply(
F&& f,
llvm::BitVector& Out,
const llvm::BitVector& Arg,
const ArgTys&... Args)
template <class F, class... ArgTys>
static llvm::BitVector& apply(
F&& f,
llvm::BitVector& Out,
const llvm::BitVector& Arg,
const ArgTys&... Args)
Declared at: llvm/include/llvm/ADT/BitVector.h:545
Templates
- F
- ArgTys
Parameters
- F&& f
- llvm::BitVector& Out
- const llvm::BitVector& Arg
- const ArgTys&... Args
¶template <bool AddBits, bool InvertMask>
void applyMask(const uint32_t* Mask,
unsigned int MaskWords)
template <bool AddBits, bool InvertMask>
void applyMask(const uint32_t* Mask,
unsigned int MaskWords)
Declared at: llvm/include/llvm/ADT/BitVector.h:796
Templates
- bool AddBits
- bool InvertMask
Parameters
- const uint32_t* Mask
- unsigned int MaskWords
¶bool back() const
bool back() const
Description
Return the last element in the vector.
Declared at: llvm/include/llvm/ADT/BitVector.h:449
¶void clear()
void clear()
Description
clear - Removes all bits from the bitvector.
Declared at: llvm/include/llvm/ADT/BitVector.h:328
¶void clearBitsInMask(const uint32_t* Mask,
unsigned int MaskWords = ~0U)
void clearBitsInMask(const uint32_t* Mask,
unsigned int MaskWords = ~0U)
Description
clearBitsInMask - Clear any bits in this vector that are set in Mask. Don't resize. This computes "*this &= ~Mask".
Declared at: llvm/include/llvm/ADT/BitVector.h:706
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
clearBitsNotInMask - 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/BitVector.h:718
Parameters
- const uint32_t* Mask
- unsigned int MaskWords = ~0U
¶void clear_unused_bits()
void clear_unused_bits()
Declared at: llvm/include/llvm/ADT/BitVector.h:787
¶llvm::BitVector::size_type count() const
llvm::BitVector::size_type count() const
Description
count - Returns the number of bits which are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:155
¶bool empty() const
bool empty() const
Description
empty - Tests whether there are no bits in this bitvector.
Declared at: llvm/include/llvm/ADT/BitVector.h:149
¶int find_first() const
int find_first() const
Description
find_first - Returns the index of the first set bit, -1 if none of the bits are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:293
¶int find_first_in(unsigned int Begin,
unsigned int End,
bool Set = true) const
int find_first_in(unsigned int Begin,
unsigned int End,
bool Set = true) const
Description
find_first_in - Returns the index of the first set / unset bit, depending on \p Set, in the range [Begin, End). Returns -1 if all bits in the range are unset / set.
Declared at: llvm/include/llvm/ADT/BitVector.h:188
Parameters
- unsigned int Begin
- unsigned int End
- bool Set = true
¶int find_first_unset() const
int find_first_unset() const
Description
find_first_unset - Returns the index of the first unset bit, -1 if all of the bits are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:309
¶int find_first_unset_in(unsigned int Begin,
unsigned int End) const
int find_first_unset_in(unsigned int Begin,
unsigned int End) const
Description
find_first_unset_in - Returns the index of the first unset bit in the range [Begin, End). Returns -1 if all bits in the range are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:254
Parameters
- unsigned int Begin
- unsigned int End
¶int find_last() const
int find_last() const
Description
find_last - Returns the index of the last set bit, -1 if none of the bits are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:297
¶int find_last_in(unsigned int Begin,
unsigned int End) const
int find_last_in(unsigned int Begin,
unsigned int End) const
Description
find_last_in - Returns the index of the last set bit in the range [Begin, End). Returns -1 if all bits in the range are unset.
Declared at: llvm/include/llvm/ADT/BitVector.h:223
Parameters
- unsigned int Begin
- unsigned int End
¶int find_last_unset() const
int find_last_unset() const
Description
find_last_unset - Returns the index of the last unset bit, -1 if all of the bits are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:319
¶int find_last_unset_in(unsigned int Begin,
unsigned int End) const
int find_last_unset_in(unsigned int Begin,
unsigned int End) const
Description
find_last_unset_in - Returns the index of the last unset bit in the range [Begin, End). Returns -1 if all bits in the range are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:260
Parameters
- unsigned int Begin
- unsigned int End
¶int find_next(unsigned int Prev) const
int find_next(unsigned int Prev) const
Description
find_next - 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/BitVector.h:301
Parameters
- unsigned int Prev
¶int find_next_unset(unsigned int Prev) const
int find_next_unset(unsigned int Prev) const
Description
find_next_unset - Returns the index of the next unset bit following the "Prev" bit. Returns -1 if all remaining bits are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:313
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/BitVector.h:305
Parameters
- unsigned int PriorTo
¶int find_prev_unset(unsigned int PriorTo)
int find_prev_unset(unsigned int PriorTo)
Description
find_prev_unset - Returns the index of the first unset bit that precedes the bit at \p PriorTo. Returns -1 if all previous bits are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:323
Parameters
- unsigned int PriorTo
¶llvm::BitVector& flip()
llvm::BitVector& flip()
Declared at: llvm/include/llvm/ADT/BitVector.h:424
¶llvm::BitVector& flip(unsigned int Idx)
llvm::BitVector& flip(unsigned int Idx)
Declared at: llvm/include/llvm/ADT/BitVector.h:431
Parameters
- unsigned int Idx
¶llvm::BitVector::size_type getBitCapacity() const
llvm::BitVector::size_type getBitCapacity() const
Declared at: llvm/include/llvm/ADT/BitVector.h:825
¶ArrayRef<llvm::BitVector::BitWord> getData() const
ArrayRef<llvm::BitVector::BitWord> getData() const
Declared at: llvm/include/llvm/ADT/BitVector.h:684
¶llvm::BitVector::size_type getMemorySize() const
llvm::BitVector::size_type getMemorySize() const
Description
Return the size (in bytes) of the bit vector.
Declared at: llvm/include/llvm/ADT/BitVector.h:824
¶void init_words(bool t)
void init_words(bool t)
Declared at: llvm/include/llvm/ADT/BitVector.h:791
Parameters
- bool t
¶void invalid()
void invalid()
Declared at: llvm/include/llvm/ADT/BitVector.h:678
¶bool isInvalid() const
bool isInvalid() const
Declared at: llvm/include/llvm/ADT/BitVector.h:682
¶int next_unset_in_word(
int WordIndex,
llvm::BitVector::BitWord Word) const
int next_unset_in_word(
int WordIndex,
llvm::BitVector::BitWord Word) const
Declared at: llvm/include/llvm/ADT/BitVector.h:765
Parameters
- int WordIndex
- llvm::BitVector::BitWord Word
¶bool none() const
bool none() const
Description
none - Returns true if none of the bits are set.
Declared at: llvm/include/llvm/ADT/BitVector.h:181
¶void pop_back()
void pop_back()
Description
Pop one bit from the end of the vector.
Declared at: llvm/include/llvm/ADT/BitVector.h:476
¶void push_back(bool Val)
void push_back(bool Val)
Declared at: llvm/include/llvm/ADT/BitVector.h:459
Parameters
- bool Val
¶void reserve(unsigned int N)
void reserve(unsigned int N)
Declared at: llvm/include/llvm/ADT/BitVector.h:341
Parameters
- unsigned int N
¶llvm::BitVector& reset(unsigned int Idx)
llvm::BitVector& reset(unsigned int Idx)
Declared at: llvm/include/llvm/ADT/BitVector.h:390
Parameters
- unsigned int Idx
¶llvm::BitVector& reset(const llvm::BitVector& RHS)
llvm::BitVector& reset(const llvm::BitVector& RHS)
Description
reset - Reset bits that are set in RHS. Same as *this & = ~RHS.
Declared at: llvm/include/llvm/ADT/BitVector.h:519
Parameters
- const llvm::BitVector& RHS
¶llvm::BitVector& reset(unsigned int I,
unsigned int E)
llvm::BitVector& reset(unsigned int I,
unsigned int E)
Description
reset - Efficiently reset a range of bits in [I, E)
Declared at: llvm/include/llvm/ADT/BitVector.h:396
Parameters
- unsigned int I
- unsigned int E
¶llvm::BitVector& reset()
llvm::BitVector& reset()
Declared at: llvm/include/llvm/ADT/BitVector.h:385
¶void resize(unsigned int N, bool t = false)
void resize(unsigned int N, bool t = false)
Description
resize - Grow or shrink the bitvector.
Declared at: llvm/include/llvm/ADT/BitVector.h:334
Parameters
- unsigned int N
- bool t = false
¶llvm::BitVector& set(unsigned int I,
unsigned int E)
llvm::BitVector& set(unsigned int I,
unsigned int E)
Description
set - Efficiently set a range of bits in [I, E)
Declared at: llvm/include/llvm/ADT/BitVector.h:357
Parameters
- unsigned int I
- unsigned int E
¶llvm::BitVector& set(unsigned int Idx)
llvm::BitVector& set(unsigned int Idx)
Declared at: llvm/include/llvm/ADT/BitVector.h:350
Parameters
- unsigned int Idx
¶llvm::BitVector& set()
llvm::BitVector& set()
Declared at: llvm/include/llvm/ADT/BitVector.h:344
¶void setBitsInMask(const uint32_t* Mask,
unsigned int MaskWords = ~0U)
void setBitsInMask(const uint32_t* Mask,
unsigned int MaskWords = ~0U)
Description
setBitsInMask - Add '1' bits from Mask to this vector. Don't resize. This computes "*this |= Mask".
Declared at: llvm/include/llvm/ADT/BitVector.h:700
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
setBitsNotInMask - 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/BitVector.h:712
Parameters
- const uint32_t* Mask
- unsigned int MaskWords = ~0U
¶iterator_range<
llvm::BitVector::const_set_bits_iterator>
set_bits() const
iterator_range<
llvm::BitVector::const_set_bits_iterator>
set_bits() const
Declared at: llvm/include/llvm/ADT/BitVector.h:133
¶llvm::BitVector::const_set_bits_iterator
set_bits_begin() const
llvm::BitVector::const_set_bits_iterator
set_bits_begin() const
Declared at: llvm/include/llvm/ADT/BitVector.h:127
¶llvm::BitVector::const_set_bits_iterator
set_bits_end() const
llvm::BitVector::const_set_bits_iterator
set_bits_end() const
Declared at: llvm/include/llvm/ADT/BitVector.h:130
¶void set_unused_bits(bool t = true)
void set_unused_bits(bool t = true)
Declared at: llvm/include/llvm/ADT/BitVector.h:775
Parameters
- bool t = true
¶llvm::BitVector::size_type size() const
llvm::BitVector::size_type size() const
Description
size - Returns the number of bits in this bitvector.
Declared at: llvm/include/llvm/ADT/BitVector.h:152
¶void swap(llvm::BitVector& RHS)
void swap(llvm::BitVector& RHS)
Declared at: llvm/include/llvm/ADT/BitVector.h:673
Parameters
- llvm::BitVector& RHS
¶bool test(const llvm::BitVector& RHS) const
bool test(const llvm::BitVector& RHS) const
Description
test - Check if (This - RHS) is zero. This is the same as reset(RHS) and any().
Declared at: llvm/include/llvm/ADT/BitVector.h:529
Parameters
- const llvm::BitVector& RHS
¶bool test(unsigned int Idx) const
bool test(unsigned int Idx) const
Declared at: llvm/include/llvm/ADT/BitVector.h:454
Parameters
- unsigned int Idx
¶void wordShl(uint32_t Count)
void wordShl(uint32_t Count)
Description
Perform a logical left shift of \p Count words by moving everything\p Count words to the right in memory. While confusing, words are stored from least significant at Bits[0] to most significant at Bits[NumWords-1]. A logical shift left, however, moves the current least significant bit to a higher logical index, and fills the previous least significant bits with 0. Thus, we actually need to move the bytes of the memory to the right, not to the left. Example: Words = [0xBBBBAAAA, 0xDDDDFFFF, 0x00000000, 0xDDDD0000] represents a BitVector where 0xBBBBAAAA contain the least significant bits. So if we want to shift the BitVector left by 2 words, we need to turn this into 0x00000000 0x00000000 0xBBBBAAAA 0xDDDDFFFF by using a memmove which moves right, not left.
Declared at: llvm/include/llvm/ADT/BitVector.h:737
Parameters
- uint32_t Count
¶void wordShr(uint32_t Count)
void wordShr(uint32_t Count)
Description
Perform a logical right shift of \p Count words by moving those words to the left in memory. See wordShl for more information.
Declared at: llvm/include/llvm/ADT/BitVector.h:755
Parameters
- uint32_t Count