LLVM API Documentation

Classes | Public Member Functions
llvm::BitVector Class Reference

#include <BitVector.h>

List of all members.

Classes

class  reference

Public Member Functions

 BitVector ()
 BitVector default ctor - Creates an empty bitvector.
 BitVector (unsigned s, bool t=false)
 BitVector (const BitVector &RHS)
 BitVector copy ctor.
 ~BitVector ()
bool empty () const
 empty - Tests whether there are no bits in this bitvector.
unsigned size () const
 size - Returns the number of bits in this bitvector.
unsigned count () const
 count - Returns the number of bits which are set.
bool any () const
 any - Returns true if any bit is set.
bool all () const
 all - Returns true if all bits are set.
bool none () const
 none - Returns true if none of the bits are set.
int find_first () const
int find_next (unsigned Prev) const
void clear ()
 clear - Clear all bits.
void resize (unsigned N, bool t=false)
 resize - Grow or shrink the bitvector.
void reserve (unsigned N)
BitVectorset ()
BitVectorset (unsigned Idx)
BitVectorset (unsigned I, unsigned E)
 set - Efficiently set a range of bits in [I, E)
BitVectorreset ()
BitVectorreset (unsigned Idx)
BitVectorreset (unsigned I, unsigned E)
 reset - Efficiently reset a range of bits in [I, E)
BitVectorflip ()
BitVectorflip (unsigned Idx)
reference operator[] (unsigned Idx)
bool operator[] (unsigned Idx) const
bool test (unsigned Idx) const
bool anyCommon (const BitVector &RHS) const
 Test if any common bits are set.
bool operator== (const BitVector &RHS) const
bool operator!= (const BitVector &RHS) const
BitVectoroperator&= (const BitVector &RHS)
 Intersection, union, disjoint union.
BitVectorreset (const BitVector &RHS)
 reset - Reset bits that are set in RHS. Same as *this &= ~RHS.
bool test (const BitVector &RHS) const
BitVectoroperator|= (const BitVector &RHS)
BitVectoroperator^= (const BitVector &RHS)
const BitVectoroperator= (const BitVector &RHS)
void swap (BitVector &RHS)
void setBitsInMask (const uint32_t *Mask, unsigned MaskWords=~0u)
void clearBitsInMask (const uint32_t *Mask, unsigned MaskWords=~0u)
void setBitsNotInMask (const uint32_t *Mask, unsigned MaskWords=~0u)
void clearBitsNotInMask (const uint32_t *Mask, unsigned MaskWords=~0u)

Detailed Description

Definition at line 27 of file BitVector.h.


Constructor & Destructor Documentation

llvm::BitVector::BitVector ( ) [inline]

BitVector default ctor - Creates an empty bitvector.

Definition at line 74 of file BitVector.h.

References llvm::tgtok::Bits.

llvm::BitVector::BitVector ( unsigned  s,
bool  t = false 
) [inline, explicit]

BitVector ctor - Creates a bitvector of specified number of bits. All bits are initialized to the specified value.

Definition at line 80 of file BitVector.h.

References llvm::tgtok::Bits, and llvm::LibFunc::malloc.

llvm::BitVector::BitVector ( const BitVector RHS) [inline]

BitVector copy ctor.

Definition at line 89 of file BitVector.h.

References llvm::tgtok::Bits, llvm::LibFunc::malloc, llvm::LibFunc::memcpy, and size().

llvm::BitVector::~BitVector ( ) [inline]

Definition at line 108 of file BitVector.h.

References llvm::tgtok::Bits, and llvm::LibFunc::free.


Member Function Documentation

bool llvm::BitVector::all ( ) const [inline]

all - Returns true if all bits are set.

Definition at line 140 of file BitVector.h.

References count(), and size().

Referenced by llvm::SmallBitVector::all().

bool llvm::BitVector::any ( ) const [inline]

any - Returns true if any bit is set.

Definition at line 132 of file BitVector.h.

References llvm::tgtok::Bits, and size().

Referenced by llvm::SmallBitVector::any(), llvm::AggressiveAntiDepBreaker::BreakAntiDependencies(), none(), and llvm::RegScavenger::scavengeRegister().

bool llvm::BitVector::anyCommon ( const BitVector RHS) const [inline]

Test if any common bits are set.

Definition at line 335 of file BitVector.h.

References llvm::tgtok::Bits, and size().

Referenced by llvm::SmallBitVector::anyCommon().

void llvm::BitVector::clear ( ) [inline]
void llvm::BitVector::clearBitsInMask ( const uint32_t *  Mask,
unsigned  MaskWords = ~0u 
) [inline]

clearBitsInMask - Clear any bits in this vector that are set in Mask. Don't resize. This computes "*this &= ~Mask".

Definition at line 496 of file BitVector.h.

Referenced by llvm::SmallBitVector::clearBitsInMask().

void llvm::BitVector::clearBitsNotInMask ( const uint32_t *  Mask,
unsigned  MaskWords = ~0u 
) [inline]

clearBitsNotInMask - Clear a bit in this vector for every '0' bit in Mask. Don't resize. This computes "*this &= Mask".

Definition at line 508 of file BitVector.h.

Referenced by llvm::LiveIntervals::checkRegMaskInterference(), and llvm::SmallBitVector::clearBitsNotInMask().

unsigned llvm::BitVector::count ( ) const [inline]

count - Returns the number of bits which are set.

Definition at line 119 of file BitVector.h.

References llvm::tgtok::Bits, llvm::CountPopulation_32(), llvm::CountPopulation_64(), llvm_unreachable, and size().

Referenced by all(), and llvm::SmallBitVector::count().

bool llvm::BitVector::empty ( ) const [inline]

empty - Tests whether there are no bits in this bitvector.

Definition at line 113 of file BitVector.h.

Referenced by llvm::PBQPBuilder::build(), llvm::LiveRegMatrix::checkRegMaskInterference(), llvm::SmallBitVector::empty(), and llvm::MachineRegisterInfo::reservedRegsFrozen().

int llvm::BitVector::find_first ( ) const [inline]
int llvm::BitVector::find_next ( unsigned  Prev) const [inline]

find_next - Returns the index of the next set bit following the "Prev" bit. Returns -1 if the next set bit is not found.

Definition at line 166 of file BitVector.h.

References llvm::tgtok::Bits, llvm::CountTrailingZeros_32(), llvm::CountTrailingZeros_64(), llvm_unreachable, and size().

Referenced by llvm::AggressiveAntiDepBreaker::AggressiveAntiDepBreaker(), llvm::SmallBitVector::find_next(), llvm::SpillPlacement::finish(), llvm::RegScavenger::initRegState(), and llvm::SpillPlacement::scanActiveBundles().

BitVector& llvm::BitVector::flip ( ) [inline]
BitVector& llvm::BitVector::flip ( unsigned  Idx) [inline]

Definition at line 313 of file BitVector.h.

References llvm::tgtok::Bits.

bool llvm::BitVector::none ( ) const [inline]

none - Returns true if none of the bits are set.

Definition at line 146 of file BitVector.h.

References any().

Referenced by llvm::AggressiveAntiDepBreaker::AggressiveAntiDepBreaker(), and llvm::SmallBitVector::none().

bool llvm::BitVector::operator!= ( const BitVector RHS) const [inline]

Definition at line 366 of file BitVector.h.

BitVector& llvm::BitVector::operator&= ( const BitVector RHS) [inline]

Intersection, union, disjoint union.

Definition at line 371 of file BitVector.h.

References llvm::tgtok::Bits, and size().

const BitVector& llvm::BitVector::operator= ( const BitVector RHS) [inline]
bool llvm::BitVector::operator== ( const BitVector RHS) const [inline]

Definition at line 345 of file BitVector.h.

References llvm::tgtok::Bits, and size().

reference llvm::BitVector::operator[] ( unsigned  Idx) [inline]

Definition at line 319 of file BitVector.h.

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

Definition at line 324 of file BitVector.h.

References llvm::tgtok::Bits.

BitVector& llvm::BitVector::operator^= ( const BitVector RHS) [inline]

Definition at line 422 of file BitVector.h.

References llvm::tgtok::Bits, resize(), and size().

BitVector& llvm::BitVector::operator|= ( const BitVector RHS) [inline]

Definition at line 414 of file BitVector.h.

References llvm::tgtok::Bits, resize(), and size().

void llvm::BitVector::reserve ( unsigned  N) [inline]

Definition at line 223 of file BitVector.h.

Referenced by llvm::SmallBitVector::reserve().

BitVector& llvm::BitVector::reset ( ) [inline]
BitVector& llvm::BitVector::reset ( unsigned  Idx) [inline]

Definition at line 273 of file BitVector.h.

References llvm::tgtok::Bits.

BitVector& llvm::BitVector::reset ( unsigned  I,
unsigned  E 
) [inline]

reset - Efficiently reset a range of bits in [I, E)

Definition at line 279 of file BitVector.h.

References llvm::tgtok::Bits, llvm::RoundUpToAlignment(), and size().

BitVector& llvm::BitVector::reset ( const BitVector RHS) [inline]

reset - Reset bits that are set in RHS. Same as *this &= ~RHS.

Definition at line 388 of file BitVector.h.

References llvm::tgtok::Bits, and size().

void llvm::BitVector::resize ( unsigned  N,
bool  t = false 
) [inline]
BitVector& llvm::BitVector::set ( ) [inline]
BitVector& llvm::BitVector::set ( unsigned  Idx) [inline]

Definition at line 235 of file BitVector.h.

References llvm::tgtok::Bits.

BitVector& llvm::BitVector::set ( unsigned  I,
unsigned  E 
) [inline]

set - Efficiently set a range of bits in [I, E)

Definition at line 241 of file BitVector.h.

References llvm::tgtok::Bits, I, llvm::RoundUpToAlignment(), and size().

void llvm::BitVector::setBitsInMask ( const uint32_t *  Mask,
unsigned  MaskWords = ~0u 
) [inline]

setBitsInMask - Add '1' bits from Mask to this vector. Don't resize. This computes "*this |= Mask".

Definition at line 490 of file BitVector.h.

Referenced by llvm::TargetLoweringBase::findRepresentativeClass(), and llvm::SmallBitVector::setBitsInMask().

void llvm::BitVector::setBitsNotInMask ( const uint32_t *  Mask,
unsigned  MaskWords = ~0u 
) [inline]

setBitsNotInMask - Add a bit to this vector for every '0' bit in Mask. Don't resize. This computes "*this |= ~Mask".

Definition at line 502 of file BitVector.h.

Referenced by llvm::MachineRegisterInfo::addPhysRegsUsedFromRegMask(), and llvm::SmallBitVector::setBitsNotInMask().

unsigned llvm::BitVector::size ( ) const [inline]
void llvm::BitVector::swap ( BitVector RHS) [inline]

Definition at line 470 of file BitVector.h.

References llvm::tgtok::Bits.

Referenced by std::swap().

bool llvm::BitVector::test ( unsigned  Idx) const [inline]
bool llvm::BitVector::test ( const BitVector RHS) const [inline]

test - Check if (This - RHS) is zero. This is the same as reset(RHS) and any().

Definition at line 399 of file BitVector.h.

References llvm::tgtok::Bits, and size().


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