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:35

Member Variables

private uintptr_t X = 1

Method Overview

  • public SmallBitVector(llvm::SmallBitVector && RHS)
  • public SmallBitVector(const llvm::SmallBitVector & RHS)
  • public SmallBitVector(unsigned int s, bool t = false)
  • public SmallBitVector()
  • public bool all() const
  • public bool any() const
  • public bool anyCommon(const llvm::SmallBitVector & RHS) const
  • 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)
  • 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()
  • public llvm::SmallBitVector & flip(unsigned int Idx)
  • public ArrayRef<uintptr_t> getData(uintptr_t & Store) const
  • private llvm::BitVector * getPointer() const
  • private uintptr_t getSmallBits() const
  • private uintptr_t getSmallRawBits() const
  • private llvm::SmallBitVector::size_type getSmallSize() const
  • public void invalid()
  • public bool isInvalid() const
  • public bool isSmall() const
  • public bool none() const
  • public void pop_back()
  • public void push_back(bool Val)
  • public void reserve(unsigned int N)
  • public llvm::SmallBitVector & reset(const llvm::SmallBitVector & RHS)
  • public llvm::SmallBitVector & reset(unsigned int I, unsigned int E)
  • public llvm::SmallBitVector & reset(unsigned int Idx)
  • public llvm::SmallBitVector & reset()
  • public void resize(unsigned int N, bool t = false)
  • public llvm::SmallBitVector & set(unsigned int I, unsigned int E)
  • public llvm::SmallBitVector & set(unsigned int Idx)
  • 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)
  • private void setSmallBits(uintptr_t NewBits)
  • private void setSmallRawBits(uintptr_t NewRawBits)
  • private void setSmallSize(llvm::SmallBitVector::size_type Size)
  • 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 llvm::SmallBitVector::size_type size() const
  • public void swap(llvm::SmallBitVector & RHS)
  • private void switchToLarge(llvm::BitVector * BV)
  • private void switchToSmall(uintptr_t NewSmallBits, llvm::SmallBitVector::size_type NewSize)
  • public bool test(const llvm::SmallBitVector & RHS) const
  • public bool test(unsigned int Idx) const
  • public ~SmallBitVector()

Methods

SmallBitVector(llvm::SmallBitVector&& RHS)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:163

Parameters

llvm::SmallBitVector&& RHS

SmallBitVector(const llvm::SmallBitVector& RHS)

Description

SmallBitVector copy ctor.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:156

Parameters

const llvm::SmallBitVector& RHS

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:148

Parameters

unsigned int s
bool t = false

SmallBitVector()

Description

Creates an empty bitvector.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:144

bool all() const

Description

Returns true if all bits are set.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:216

bool any() const

Description

Returns true if any bit is set.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:209

bool anyCommon(
    const llvm::SmallBitVector& RHS) const

Description

Test if any common bits are set.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:488

Parameters

const llvm::SmallBitVector& RHS

template <bool AddBits, bool InvertMask>
void applyMask(const uint32_t* Mask,
               unsigned int MaskWords)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:695

Templates

bool AddBits
bool InvertMask

Parameters

const uint32_t* Mask
unsigned int MaskWords

bool back() const

Description

Return the last element in the vector.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:467

void clear()

Description

Clear all bits.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:325

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:655

Parameters

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:673

Parameters

const uint32_t* Mask
unsigned int MaskWords = ~0U

llvm::SmallBitVector::size_type count() const

Description

Returns the number of bits which are set.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:200

bool empty() const

Description

Tests whether there are no bits in this bitvector.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:190

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:230

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:251

int find_last() const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:240

int find_last_unset() const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:262

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:277

Parameters

unsigned int Prev

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:291

Parameters

unsigned int Prev

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:308

Parameters

unsigned int PriorTo

llvm::SmallBitVector& flip()

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:432

llvm::SmallBitVector& flip(unsigned int Idx)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:440

Parameters

unsigned int Idx

ArrayRef<uintptr_t> getData(
    uintptr_t& Store) const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:686

Parameters

uintptr_t& Store

llvm::BitVector* getPointer() const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:95

uintptr_t getSmallBits() const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:133

uintptr_t getSmallRawBits() const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:113

llvm::SmallBitVector::size_type getSmallSize()
    const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:124

void invalid()

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:680

bool isInvalid() const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:684

bool isSmall() const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:187

bool none() const

Description

Returns true if none of the bits are set.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:223

void pop_back()

Description

Pop one bit from the end of the vector.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:482

void push_back(bool Val)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:477

Parameters

bool Val

void reserve(unsigned int N)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:348

Parameters

unsigned int N

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:540

Parameters

const llvm::SmallBitVector& RHS

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:418

Parameters

unsigned int I
unsigned int E

llvm::SmallBitVector& reset(unsigned int Idx)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:409

Parameters

unsigned int Idx

llvm::SmallBitVector& reset()

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:401

void resize(unsigned int N, bool t = false)

Description

Grow or shrink the bitvector.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:332

Parameters

unsigned int N
bool t = false

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:387

Parameters

unsigned int I
unsigned int E

llvm::SmallBitVector& set(unsigned int Idx)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:374

Parameters

unsigned int Idx

llvm::SmallBitVector& set()

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:366

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:646

Parameters

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:664

Parameters

const uint32_t* Mask
unsigned int MaskWords = ~0U

void setSmallBits(uintptr_t NewBits)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:137

Parameters

uintptr_t NewBits

void setSmallRawBits(uintptr_t NewRawBits)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:118

Parameters

uintptr_t NewRawBits

void setSmallSize(
    llvm::SmallBitVector::size_type Size)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:128

Parameters

llvm::SmallBitVector::size_type Size

iterator_range<
    llvm::SmallBitVector::const_set_bits_iterator>
set_bits() const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:183

llvm::SmallBitVector::const_set_bits_iterator
set_bits_begin() const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:175

llvm::SmallBitVector::const_set_bits_iterator
set_bits_end() const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:179

llvm::SmallBitVector::size_type size() const

Description

Returns the number of bits in this bitvector.

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:195

void swap(llvm::SmallBitVector& RHS)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:640

Parameters

llvm::SmallBitVector& RHS

void switchToLarge(llvm::BitVector* BV)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:106

Parameters

llvm::BitVector* BV

void switchToSmall(
    uintptr_t NewSmallBits,
    llvm::SmallBitVector::size_type NewSize)

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:100

Parameters

uintptr_t NewSmallBits
llvm::SmallBitVector::size_type NewSize

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:554

Parameters

const llvm::SmallBitVector& RHS

bool test(unsigned int Idx) const

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:472

Parameters

unsigned int Idx

~SmallBitVector()

Declared at: llvm/include/llvm/ADT/SmallBitVector.h:167