LLVM 19.0.0git
Public Member Functions | Protected Member Functions | List of all members
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 >:
Inheritance graph
[legend]

Public Member Functions

constexpr Bitset ()=default
 
constexpr Bitset (std::initializer_list< unsigned > Init)
 
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
 
bool any () const
 
bool none () const
 
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
 
bool operator== (const Bitset &RHS) const
 
bool operator!= (const Bitset &RHS) const
 
bool operator< (const Bitset &Other) const
 

Protected Member Functions

constexpr Bitset (const std::array< BitWord, NumWords > &B)
 

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>
constexpr llvm::Bitset< NumBits >::Bitset ( const std::array< BitWord, NumWords > &  B)
inlineconstexprprotected

Definition at line 42 of file Bitset.h.

◆ Bitset() [2/3]

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

◆ Bitset() [3/3]

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

Definition at line 47 of file Bitset.h.

References I, and llvm::Bitset< NumBits >::set().

Member Function Documentation

◆ any()

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

Definition at line 81 of file Bitset.h.

References llvm::any_of(), and I.

Referenced by llvm::Bitset< NumBits >::none().

◆ count()

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

Definition at line 85 of file Bitset.h.

References B, and llvm::popcount().

◆ flip()

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

Definition at line 67 of file Bitset.h.

References I.

◆ none()

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

Definition at line 84 of file Bitset.h.

References llvm::Bitset< NumBits >::any().

◆ operator!=()

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

Definition at line 138 of file Bitset.h.

References RHS.

◆ operator&()

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

Definition at line 109 of file Bitset.h.

References RHS.

◆ operator&=()

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

Definition at line 104 of file Bitset.h.

References E, I, and RHS.

◆ operator<()

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

Definition at line 140 of file Bitset.h.

References E, I, LHS, llvm::Other, RHS, llvm::Bitset< NumBits >::size(), and test.

◆ operator==()

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

Definition at line 134 of file Bitset.h.

References RHS.

◆ operator[]()

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

Definition at line 72 of file Bitset.h.

References I.

◆ operator^()

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

Definition at line 98 of file Bitset.h.

References RHS.

◆ operator^=()

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

Definition at line 92 of file Bitset.h.

References E, I, and RHS.

◆ operator|()

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

Definition at line 121 of file Bitset.h.

References RHS.

◆ operator|=()

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

Definition at line 115 of file Bitset.h.

References E, I, and RHS.

◆ operator~()

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

Definition at line 127 of file Bitset.h.

References B.

◆ reset()

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

Definition at line 62 of file Bitset.h.

References I.

◆ set() [1/2]

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

Definition at line 52 of file Bitset.h.

Referenced by llvm::Bitset< NumBits >::Bitset().

◆ set() [2/2]

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

Definition at line 57 of file Bitset.h.

References I.

◆ size()

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

Definition at line 79 of file Bitset.h.

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

◆ test()

template<unsigned NumBits>
constexpr bool llvm::Bitset< NumBits >::test ( unsigned  I) const
inlineconstexpr

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