llvm::SmallBitVector

Variable-sized bit array optimized for small bit counts.

Synopsis

Declared in <llvm/ADT/SmallBitVector.h>

class SmallBitVector;

Description

Uses one pointer-sized field as either an inline bit collection or a pointer to a larger heap-allocated array, so small cases stay fast without losing generality for large inputs.

Types

NameDescription
reference Mutable proxy referring to a single bit in a SmallBitVector.

Type Aliases

NameDescription
const_set_bits_iterator Iterator over indices of set bits.
set_iterator Alias for const_set_bits_iterator.
size_type Type used for bit indices and sizes.

Member Functions

NameDescription
SmallBitVector [constructor]Constructors
~SmallBitVector [destructor]Destroy large-mode storage if this vector spilled to a BitVector.
operator= Assignment operators
all Returns true if all bits are set.
any Returns true if any bit is set.
anyCommon Test if any common bits are set.
back Return the last element in the vector.
clear Clear all bits.
clearBitsInMask Clear any bits in this vector that are set in Mask. Don't resize. This computes "*this &= ~Mask".
clearBitsNotInMask Clear a bit in this vector for every '0' bit in Mask. Don't resize. This computes "*this &= Mask".
count Returns the number of bits which are set.
empty Tests whether there are no bits in this bitvector.
find_first Returns the index of the first set bit, -1 if none of the bits are set.
find_first_unset Returns the index of the first unset bit, -1 if all of the bits are set.
find_last Returns the index of the last set bit, -1 if none of the bits are set.
find_last_unset Returns the index of the last unset bit, -1 if all of the bits are set.
find_next Returns the index of the next set bit following the "Prev" bit. Returns -1 if the next set bit is not found.
find_next_unset Returns the index of the next unset bit following the "Prev" bit. Returns -1 if the next unset bit is not found.
find_prev find_prev - Returns the index of the first set bit that precedes the the bit at PriorTo. Returns -1 if all previous bits are unset.
flip flip overloads
getData Return the underlying word storage; in small mode, write bits into Store.
isSmall Return true if this vector uses inline storage rather than a heap BitVector.
none Returns true if none of the bits are set.
operator&= Intersect this vector with RHS in place, resizing to the larger size.
operator<<= Shift bits left by N positions; vacated low bits become zero.
operator>>= Shift bits right by N positions; vacated high bits become zero.
operator[] Subscript operators
operator^= XOR this vector with RHS in place, resizing if needed.
operator|= OR this vector with RHS in place, resizing if needed.
operator~ Return a copy of this vector with every bit inverted.
pop_back Pop one bit from the end of the vector.
push_back Append a single bit to the end of the vector.
reserve Reserve space for at least N bits in the bitvector.
reset reset overloads
resize Grow or shrink the bitvector.
set set overloads
setBitsInMask Add '1' bits from Mask to this vector. Don't resize. This computes "*this |= Mask".
setBitsNotInMask Add a bit to this vector for every '0' bit in Mask. Don't resize. This computes "*this |= ~Mask".
set_bits Return a range over the indices of all set bits.
set_bits_begin Iterator to the first set bit, or end if none are set.
set_bits_end Past-the-end iterator for the set-bits range.
size Returns the number of bits in this bitvector.
subsetOf Check if This is a subset of RHS.
swap Exchange contents with RHS.
test test overloads
test_all Returns true if all bits in the range [Begin, End) are set.]
test_any Returns true if any of the bits in the range [Begin, End) are set.]
operator== Return true if this and RHS have the same size and bit pattern.
operator!= Return true if this and RHS differ in size or any bit.

Non-Member Functions

NameDescription
operator&Return the bitwise AND of LHS and RHS.
operator^Return the bitwise XOR of LHS and RHS.
operator|Return the bitwise OR of LHS and RHS.