LLVM 23.0.0git
llvm::Bitset< NumBits > Class Template Reference

This is a constexpr reimplementation of a subset of std::bitset. More...

#include "llvm/ADT/Bitset.h"

Inheritance diagram for llvm::Bitset< NumBits >:
[legend]

Public Member Functions

constexpr Bitset (const std::array< uint64_t,(NumBits+63)/64 > &B)
constexpr Bitset ()=default
constexpr Bitset (std::initializer_list< unsigned > Init)
constexpr Bitsetset ()
constexpr Bitsetset (unsigned I)
constexpr Bitsetreset (unsigned I)
constexpr Bitsetflip (unsigned I)
constexpr bool operator[] (unsigned I) const
constexpr bool test (unsigned I) const
constexpr size_t size () const
constexpr bool any () const
constexpr bool none () const
constexpr bool all () const
constexpr size_t count () const
constexpr Bitsetoperator^= (const Bitset &RHS)
constexpr Bitset operator^ (const Bitset &RHS) const
constexpr Bitsetoperator&= (const Bitset &RHS)
constexpr Bitset operator& (const Bitset &RHS) const
constexpr Bitsetoperator|= (const Bitset &RHS)
constexpr Bitset operator| (const Bitset &RHS) const
constexpr Bitset operator~ () const
constexpr bool operator== (const Bitset &RHS) const
constexpr bool operator!= (const Bitset &RHS) const
constexpr bool operator< (const Bitset &Other) const
constexpr Bitsetoperator<<= (unsigned N)
constexpr Bitset operator<< (unsigned N) const
constexpr Bitsetoperator>>= (unsigned N)
constexpr Bitset operator>> (unsigned N) const
constexpr uint64_t getWord64 (unsigned I) const
 Return the I-th 64-bit word of the bitset, from least significant to most.
constexpr int findLastSet () const
 Return the index of the highest set bit, or -1 if no bits are set.

Static Public Member Functions

static constexpr unsigned getNumWords64 ()
 Return the number of 64-bit words needed to hold all bits.

Detailed Description

template<unsigned NumBits>
class llvm::Bitset< NumBits >

This is a constexpr reimplementation of a subset of std::bitset.

It would be nice to use std::bitset directly, but it doesn't support constant initialization.

Definition at line 30 of file Bitset.h.

Constructor & Destructor Documentation

◆ Bitset() [1/3]

template<unsigned NumBits>
llvm::Bitset< NumBits >::Bitset ( const std::array< uint64_t,(NumBits+63)/64 > & B)
inlineexplicitconstexpr

Definition at line 56 of file Bitset.h.

◆ Bitset() [2/3]

template<unsigned NumBits>
llvm::Bitset< NumBits >::Bitset ( )
constexprdefault

◆ Bitset() [3/3]

template<unsigned NumBits>
llvm::Bitset< NumBits >::Bitset ( std::initializer_list< unsigned > Init)
inlineconstexpr

Definition at line 76 of file Bitset.h.

Member Function Documentation

◆ all()

template<unsigned NumBits>
bool llvm::Bitset< NumBits >::all ( ) const
inlineconstexpr

Definition at line 122 of file Bitset.h.

◆ any()

template<unsigned NumBits>
bool llvm::Bitset< NumBits >::any ( ) const
inlineconstexpr

Definition at line 113 of file Bitset.h.

Referenced by isAspectNeeded(), and llvm::Bitset< AEK_NUM_EXTENSIONS >::none().

◆ count()

template<unsigned NumBits>
size_t llvm::Bitset< NumBits >::count ( ) const
inlineconstexpr

Definition at line 130 of file Bitset.h.

◆ findLastSet()

template<unsigned NumBits>
int llvm::Bitset< NumBits >::findLastSet ( ) const
inlineconstexpr

Return the index of the highest set bit, or -1 if no bits are set.

Definition at line 278 of file Bitset.h.

◆ flip()

template<unsigned NumBits>
Bitset & llvm::Bitset< NumBits >::flip ( unsigned I)
inlineconstexpr

Definition at line 99 of file Bitset.h.

◆ getNumWords64()

template<unsigned NumBits>
constexpr unsigned llvm::Bitset< NumBits >::getNumWords64 ( )
inlinestaticconstexpr

Return the number of 64-bit words needed to hold all bits.

Definition at line 289 of file Bitset.h.

Referenced by llvm::Bitset< AEK_NUM_EXTENSIONS >::getWord64().

◆ getWord64()

template<unsigned NumBits>
uint64_t llvm::Bitset< NumBits >::getWord64 ( unsigned I) const
inlineconstexpr

Return the I-th 64-bit word of the bitset, from least significant to most.

All words other than the last contain exactly 64 stored bits. The last word (I == getNumWords64() - 1) may cover fewer than 64 stored bits when NumBits is not a multiple of 64; in that case the unused high bits are reported as 0.

Definition at line 266 of file Bitset.h.

◆ none()

template<unsigned NumBits>
bool llvm::Bitset< NumBits >::none ( ) const
inlineconstexpr

Definition at line 120 of file Bitset.h.

◆ operator!=()

template<unsigned NumBits>
bool llvm::Bitset< NumBits >::operator!= ( const Bitset< NumBits > & RHS) const
inlineconstexpr

Definition at line 187 of file Bitset.h.

◆ operator&()

template<unsigned NumBits>
Bitset llvm::Bitset< NumBits >::operator& ( const Bitset< NumBits > & RHS) const
inlineconstexpr

Definition at line 154 of file Bitset.h.

◆ operator&=()

template<unsigned NumBits>
Bitset & llvm::Bitset< NumBits >::operator&= ( const Bitset< NumBits > & RHS)
inlineconstexpr

Definition at line 149 of file Bitset.h.

◆ operator<()

template<unsigned NumBits>
bool llvm::Bitset< NumBits >::operator< ( const Bitset< NumBits > & Other) const
inlineconstexpr

Definition at line 189 of file Bitset.h.

◆ operator<<()

template<unsigned NumBits>
Bitset llvm::Bitset< NumBits >::operator<< ( unsigned N) const
inlineconstexpr

Definition at line 224 of file Bitset.h.

◆ operator<<=()

template<unsigned NumBits>
Bitset & llvm::Bitset< NumBits >::operator<<= ( unsigned N)
inlineconstexpr

Definition at line 198 of file Bitset.h.

◆ operator==()

template<unsigned NumBits>
bool llvm::Bitset< NumBits >::operator== ( const Bitset< NumBits > & RHS) const
inlineconstexpr

Definition at line 180 of file Bitset.h.

◆ operator>>()

template<unsigned NumBits>
Bitset llvm::Bitset< NumBits >::operator>> ( unsigned N) const
inlineconstexpr

Definition at line 254 of file Bitset.h.

◆ operator>>=()

template<unsigned NumBits>
Bitset & llvm::Bitset< NumBits >::operator>>= ( unsigned N)
inlineconstexpr

Definition at line 230 of file Bitset.h.

◆ operator[]()

template<unsigned NumBits>
bool llvm::Bitset< NumBits >::operator[] ( unsigned I) const
inlineconstexpr

Definition at line 104 of file Bitset.h.

◆ operator^()

template<unsigned NumBits>
Bitset llvm::Bitset< NumBits >::operator^ ( const Bitset< NumBits > & RHS) const
inlineconstexpr

Definition at line 143 of file Bitset.h.

◆ operator^=()

template<unsigned NumBits>
Bitset & llvm::Bitset< NumBits >::operator^= ( const Bitset< NumBits > & RHS)
inlineconstexpr

Definition at line 137 of file Bitset.h.

◆ operator|()

template<unsigned NumBits>
Bitset llvm::Bitset< NumBits >::operator| ( const Bitset< NumBits > & RHS) const
inlineconstexpr

Definition at line 166 of file Bitset.h.

◆ operator|=()

template<unsigned NumBits>
Bitset & llvm::Bitset< NumBits >::operator|= ( const Bitset< NumBits > & RHS)
inlineconstexpr

Definition at line 160 of file Bitset.h.

◆ operator~()

template<unsigned NumBits>
Bitset llvm::Bitset< NumBits >::operator~ ( ) const
inlineconstexpr

Definition at line 172 of file Bitset.h.

◆ reset()

template<unsigned NumBits>
Bitset & llvm::Bitset< NumBits >::reset ( unsigned I)
inlineconstexpr

Definition at line 94 of file Bitset.h.

◆ set() [1/2]

template<unsigned NumBits>
Bitset & llvm::Bitset< NumBits >::set ( )
inlineconstexpr

◆ set() [2/2]

template<unsigned NumBits>
Bitset & llvm::Bitset< NumBits >::set ( unsigned I)
inlineconstexpr

Definition at line 89 of file Bitset.h.

◆ size()

template<unsigned NumBits>
size_t llvm::Bitset< NumBits >::size ( ) const
inlineconstexpr

Definition at line 111 of file Bitset.h.

Referenced by llvm::Bitset< AEK_NUM_EXTENSIONS >::operator<().

◆ test()


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