LLVM: llvm::SmallBitVector Class Reference (original) (raw)

This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is small. More...

#include "[llvm/ADT/SmallBitVector.h](SmallBitVector%5F8h%5Fsource.html)"

Public Member Functions
SmallBitVector ()=default
Creates an empty bitvector.
SmallBitVector (unsigned s, bool t=false)
Creates a bitvector of specified number of bits.
SmallBitVector (const SmallBitVector &RHS)
SmallBitVector copy ctor.
SmallBitVector (SmallBitVector &&RHS)
~SmallBitVector ()
const_set_bits_iterator set_bits_begin () const
const_set_bits_iterator set_bits_end () const
iterator_range< const_set_bits_iterator > set_bits () const
bool isSmall () const
bool empty () const
Tests whether there are no bits in this bitvector.
size_type size () const
Returns the number of bits in this bitvector.
size_type count () const
Returns the number of bits which are set.
bool any () const
Returns true if any bit is set.
bool all () const
Returns true if all bits are set.
bool none () const
Returns true if none of the bits are set.
int find_first () const
Returns the index of the first set bit, -1 if none of the bits are set.
int find_last () const
int find_first_unset () const
Returns the index of the first unset bit, -1 if all of the bits are set.
int find_last_unset () const
int find_next (unsigned Prev) const
Returns the index of the next set bit following the "Prev" bit.
int find_next_unset (unsigned Prev) const
Returns the index of the next unset bit following the "Prev" bit.
int find_prev (unsigned PriorTo) const
find_prev - Returns the index of the first set bit that precedes the the bit at PriorTo.
void clear ()
Clear all bits.
void resize (unsigned N, bool t=false)
Grow or shrink the bitvector.
void reserve (unsigned N)
SmallBitVector & set ()
SmallBitVector & set (unsigned Idx)
SmallBitVector & set (unsigned I, unsigned E)
Efficiently set a range of bits in [I, E)
SmallBitVector & reset ()
SmallBitVector & reset (unsigned Idx)
SmallBitVector & reset (unsigned I, unsigned E)
Efficiently reset a range of bits in [I, E)
SmallBitVector & flip ()
SmallBitVector & flip (unsigned Idx)
SmallBitVector operator~ () const
reference operator[] (unsigned Idx)
bool operator[] (unsigned Idx) const
bool back () const
Return the last element in the vector.
bool test (unsigned Idx) const
void push_back (bool Val)
void pop_back ()
Pop one bit from the end of the vector.
bool anyCommon (const SmallBitVector &RHS) const
Test if any common bits are set.
bool operator== (const SmallBitVector &RHS) const
bool operator!= (const SmallBitVector &RHS) const
SmallBitVector & operator&= (const SmallBitVector &RHS)
SmallBitVector & reset (const SmallBitVector &RHS)
Reset bits that are set in RHS. Same as *this &= ~RHS.
bool test (const SmallBitVector &RHS) const
Check if (This - RHS) is zero. This is the same as reset(RHS) and any().
SmallBitVector & operator|= (const SmallBitVector &RHS)
SmallBitVector & operator^= (const SmallBitVector &RHS)
SmallBitVector & operator<<= (unsigned N)
SmallBitVector & operator>>= (unsigned N)
const SmallBitVector & operator= (const SmallBitVector &RHS)
const SmallBitVector & operator= (SmallBitVector &&RHS)
void swap (SmallBitVector &RHS)
void setBitsInMask (const uint32_t *Mask, unsigned MaskWords=~0u)
Add '1' bits from Mask to this vector.
void clearBitsInMask (const uint32_t *Mask, unsigned MaskWords=~0u)
Clear any bits in this vector that are set in Mask.
void setBitsNotInMask (const uint32_t *Mask, unsigned MaskWords=~0u)
Add a bit to this vector for every '0' bit in Mask.
void clearBitsNotInMask (const uint32_t *Mask, unsigned MaskWords=~0u)
Clear a bit in this vector for every '0' bit in Mask.
void invalid ()
bool isInvalid () const
ArrayRef< uintptr_t > getData (uintptr_t &Store) const

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.

Definition at line 35 of file SmallBitVector.h.

const_set_bits_iterator

set_iterator

size_type

using llvm::SmallBitVector::size_type = uintptr_t

llvm::SmallBitVector::SmallBitVector ( ) default

Creates an empty bitvector.

Referenced by anyCommon(), flip(), flip(), llvm::SmallBitVector::reference::operator bool(), operator!=(), operator&=(), operator<<=(), operator=(), operator=(), operator==(), operator>>=(), operator^=(), operator|=(), operator~(), llvm::SmallBitVector::reference::reference(), reset(), reset(), reset(), reset(), set(), set(), set(), SmallBitVector(), SmallBitVector(), swap(), and test().

SmallBitVector() [2/4]

llvm::SmallBitVector::SmallBitVector ( unsigned s, bool t = false ) inlineexplicit

Creates a bitvector of specified number of bits.

All bits are initialized to the specified value.

Definition at line 148 of file SmallBitVector.h.

SmallBitVector() [3/4]

SmallBitVector() [4/4]

~SmallBitVector()

llvm::SmallBitVector::~SmallBitVector ( ) inline

all()

bool llvm::SmallBitVector::all ( ) const inline

any()

bool llvm::SmallBitVector::any ( ) const inline

anyCommon()

back()

bool llvm::SmallBitVector::back ( ) const inline

clear()

void llvm::SmallBitVector::clear ( ) inline

clearBitsInMask()

Clear any bits in this vector that are set in Mask.

Don't resize. This computes "*this &= ~Mask".

Definition at line 657 of file SmallBitVector.h.

References isSmall().

clearBitsNotInMask()

Clear a bit in this vector for every '0' bit in Mask.

Don't resize. This computes "*this &= Mask".

Definition at line 675 of file SmallBitVector.h.

References isSmall().

count()

size_type llvm::SmallBitVector::count ( ) const inline

empty()

bool llvm::SmallBitVector::empty ( ) const inline

find_first()

int llvm::SmallBitVector::find_first ( ) const inline

find_first_unset()

int llvm::SmallBitVector::find_first_unset ( ) const inline

find_last()

int llvm::SmallBitVector::find_last ( ) const inline

find_last_unset()

int llvm::SmallBitVector::find_last_unset ( ) const inline

find_next()

int llvm::SmallBitVector::find_next ( unsigned Prev) const inline

find_next_unset()

int llvm::SmallBitVector::find_next_unset ( unsigned Prev) const inline

find_prev()

int llvm::SmallBitVector::find_prev ( unsigned PriorTo) const inline

flip() [1/2]

flip() [2/2]

getData()

ArrayRef< uintptr_t > llvm::SmallBitVector::getData ( uintptr_t & Store) const inline

invalid()

void llvm::SmallBitVector::invalid ( ) inline

isInvalid()

bool llvm::SmallBitVector::isInvalid ( ) const inline

isSmall()

bool llvm::SmallBitVector::isSmall ( ) const inline

Definition at line 187 of file SmallBitVector.h.

Referenced by all(), any(), anyCommon(), clear(), clearBitsInMask(), clearBitsNotInMask(), count(), empty(), find_first(), find_first_unset(), find_last(), find_last_unset(), find_next(), find_next_unset(), find_prev(), flip(), flip(), getData(), none(), operator&=(), operator<<=(), operator=(), operator==(), operator>>=(), operator, operator^=(), operator|=(), reserve(), reset(), reset(), reset(), reset(), resize(), set(), set(), set(), setBitsInMask(), setBitsNotInMask(), size(), test(), and ~SmallBitVector().

none()

bool llvm::SmallBitVector::none ( ) const inline

operator!=()

operator&=()

operator<<=()

operator=() [1/2]

operator=() [2/2]

operator==()

operator>>=()

operator[]() [1/2]

operator[]() [2/2]

bool llvm::SmallBitVector::operator[] ( unsigned Idx) const inline

operator^=()

operator|=()

operator~()

pop_back()

void llvm::SmallBitVector::pop_back ( ) inline

push_back()

void llvm::SmallBitVector::push_back ( bool Val) inline

reserve()

void llvm::SmallBitVector::reserve ( unsigned N) inline

reset() [1/4]

reset() [2/4]

reset() [3/4]

reset() [4/4]

resize()

void llvm::SmallBitVector::resize ( unsigned N, bool t = false ) inline

set() [1/3]

Definition at line 366 of file SmallBitVector.h.

References isSmall(), and SmallBitVector().

Referenced by llvm::DwarfExpression::addMachineReg(), areTwoInsertFromSameBuildVector(), combineOrders(), slpvectorizer::BoUpSLP::findReusedOrderedScalars(), fixupOrderingIndices(), llvm::LegalizerInfo::getAction(), getAltInstrMask(), slpvectorizer::BoUpSLP::getReorderingData(), getShufflevectorNumGroups(), llvm::MachineInstr::getTypeToPrint(), llvm::CombinerHelper::matchExtractAllEltsFromBuildVector(), slpvectorizer::BoUpSLP::VLOperands::reorder(), set(), and simplifyReductionOperand().

set() [2/3]

set() [3/3]

set_bits()

set_bits_begin()

const_set_bits_iterator llvm::SmallBitVector::set_bits_begin ( ) const inline

set_bits_end()

const_set_bits_iterator llvm::SmallBitVector::set_bits_end ( ) const inline

setBitsInMask()

Add '1' bits from Mask to this vector.

Don't resize. This computes "*this |= Mask".

Definition at line 648 of file SmallBitVector.h.

References isSmall().

setBitsNotInMask()

Add a bit to this vector for every '0' bit in Mask.

Don't resize. This computes "*this |= ~Mask".

Definition at line 666 of file SmallBitVector.h.

References isSmall().

size()

size_type llvm::SmallBitVector::size ( ) const inline

Returns the number of bits in this bitvector.

Definition at line 195 of file SmallBitVector.h.

References isSmall().

Referenced by anyCommon(), back(), llvm::X86TTIImpl::isLegalAltInstr(), operator&=(), operator==(), operator, operator, operator^=(), operator|=(), pop_back(), push_back(), reset(), reset(), set(), and test().

swap()

test() [1/2]

test() [2/2]

bool llvm::SmallBitVector::test ( unsigned Idx) const inline

The documentation for this class was generated from the following file: