clang 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
clang::interp::Boolean Class Referencefinal

Wrapper around boolean types. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/Interp/Boolean.h"

Public Member Functions

 Boolean ()
 Zero-initializes a boolean.
 
 Boolean (bool V)
 
bool operator< (Boolean RHS) const
 
bool operator> (Boolean RHS) const
 
bool operator<= (Boolean RHS) const
 
bool operator>= (Boolean RHS) const
 
bool operator== (Boolean RHS) const
 
bool operator!= (Boolean RHS) const
 
bool operator> (unsigned RHS) const
 
Boolean operator- () const
 
Boolean operator- (const Boolean &Other) const
 
Boolean operator~ () const
 
template<typename Ty , typename = std::enable_if_t<std::is_integral_v<Ty>>>
 operator Ty () const
 
APSInt toAPSInt () const
 
APSInt toAPSInt (unsigned NumBits) const
 
APValue toAPValue (const ASTContext &) const
 
Boolean toUnsigned () const
 
bool isZero () const
 
bool isMin () const
 
ComparisonCategoryResult compare (const Boolean &RHS) const
 
unsigned countLeadingZeros () const
 
Boolean truncate (unsigned TruncBits) const
 
void print (llvm::raw_ostream &OS) const
 
std::string toDiagnosticString (const ASTContext &Ctx) const
 

Static Public Member Functions

static constexpr unsigned bitWidth ()
 
static constexpr bool isMinusOne ()
 
static constexpr bool isSigned ()
 
static constexpr bool isNegative ()
 
static constexpr bool isPositive ()
 
static Boolean min (unsigned NumBits)
 
static Boolean max (unsigned NumBits)
 
template<typename T >
static Boolean from (T Value)
 
template<unsigned SrcBits, bool SrcSign>
static std::enable_if_t< SrcBits !=0, Booleanfrom (Integral< SrcBits, SrcSign > Value)
 
static Boolean zero ()
 
template<typename T >
static Boolean from (T Value, unsigned NumBits)
 
static bool inRange (int64_t Value, unsigned NumBits)
 
static bool increment (Boolean A, Boolean *R)
 
static bool decrement (Boolean A, Boolean *R)
 
static bool add (Boolean A, Boolean B, unsigned OpBits, Boolean *R)
 
static bool sub (Boolean A, Boolean B, unsigned OpBits, Boolean *R)
 
static bool mul (Boolean A, Boolean B, unsigned OpBits, Boolean *R)
 
static bool inv (Boolean A, Boolean *R)
 
static bool neg (Boolean A, Boolean *R)
 

Detailed Description

Wrapper around boolean types.

Definition at line 25 of file Boolean.h.

Constructor & Destructor Documentation

◆ Boolean() [1/2]

clang::interp::Boolean::Boolean ( )
inline

Zero-initializes a boolean.

Definition at line 32 of file Boolean.h.

References V.

Referenced by add(), from(), increment(), inv(), max(), min(), mul(), neg(), operator-(), operator~(), and sub().

◆ Boolean() [2/2]

clang::interp::Boolean::Boolean ( bool  V)
inlineexplicit

Definition at line 33 of file Boolean.h.

References V.

Member Function Documentation

◆ add()

static bool clang::interp::Boolean::add ( Boolean  A,
Boolean  B,
unsigned  OpBits,
Boolean R 
)
inlinestatic

Definition at line 125 of file Boolean.h.

References Boolean().

◆ bitWidth()

static constexpr unsigned clang::interp::Boolean::bitWidth ( )
inlinestaticconstexpr

Definition at line 63 of file Boolean.h.

◆ compare()

ComparisonCategoryResult clang::interp::Boolean::compare ( const Boolean RHS) const
inline

Definition at line 74 of file Boolean.h.

References clang::interp::Compare(), and V.

◆ countLeadingZeros()

unsigned clang::interp::Boolean::countLeadingZeros ( ) const
inline

Definition at line 78 of file Boolean.h.

References V.

◆ decrement()

static bool clang::interp::Boolean::decrement ( Boolean  A,
Boolean R 
)
inlinestatic

Definition at line 121 of file Boolean.h.

◆ from() [1/3]

template<unsigned SrcBits, bool SrcSign>
static std::enable_if_t< SrcBits !=0, Boolean > clang::interp::Boolean::from ( Integral< SrcBits, SrcSign >  Value)
inlinestatic

Definition at line 101 of file Boolean.h.

References Boolean().

◆ from() [2/3]

template<typename T >
static Boolean clang::interp::Boolean::from ( T  Value)
inlinestatic

◆ from() [3/3]

template<typename T >
static Boolean clang::interp::Boolean::from ( T  Value,
unsigned  NumBits 
)
inlinestatic

Definition at line 108 of file Boolean.h.

References Boolean().

◆ increment()

static bool clang::interp::Boolean::increment ( Boolean  A,
Boolean R 
)
inlinestatic

Definition at line 116 of file Boolean.h.

References Boolean().

◆ inRange()

static bool clang::interp::Boolean::inRange ( int64_t  Value,
unsigned  NumBits 
)
inlinestatic

Definition at line 112 of file Boolean.h.

◆ inv()

static bool clang::interp::Boolean::inv ( Boolean  A,
Boolean R 
)
inlinestatic

Definition at line 140 of file Boolean.h.

References Boolean().

Referenced by clang::interp::Inv().

◆ isMin()

bool clang::interp::Boolean::isMin ( ) const
inline

Definition at line 65 of file Boolean.h.

References isZero().

◆ isMinusOne()

static constexpr bool clang::interp::Boolean::isMinusOne ( )
inlinestaticconstexpr

Definition at line 67 of file Boolean.h.

◆ isNegative()

static constexpr bool clang::interp::Boolean::isNegative ( )
inlinestaticconstexpr

Definition at line 71 of file Boolean.h.

Referenced by isPositive().

◆ isPositive()

static constexpr bool clang::interp::Boolean::isPositive ( )
inlinestaticconstexpr

Definition at line 72 of file Boolean.h.

References isNegative().

◆ isSigned()

static constexpr bool clang::interp::Boolean::isSigned ( )
inlinestaticconstexpr

Definition at line 69 of file Boolean.h.

◆ isZero()

bool clang::interp::Boolean::isZero ( ) const
inline

Definition at line 64 of file Boolean.h.

References V.

Referenced by isMin().

◆ max()

static Boolean clang::interp::Boolean::max ( unsigned  NumBits)
inlinestatic

Definition at line 91 of file Boolean.h.

References Boolean().

◆ min()

static Boolean clang::interp::Boolean::min ( unsigned  NumBits)
inlinestatic

Definition at line 90 of file Boolean.h.

References Boolean().

◆ mul()

static bool clang::interp::Boolean::mul ( Boolean  A,
Boolean  B,
unsigned  OpBits,
Boolean R 
)
inlinestatic

Definition at line 135 of file Boolean.h.

References Boolean().

◆ neg()

static bool clang::interp::Boolean::neg ( Boolean  A,
Boolean R 
)
inlinestatic

Definition at line 145 of file Boolean.h.

References Boolean().

◆ operator Ty()

template<typename Ty , typename = std::enable_if_t<std::is_integral_v<Ty>>>
clang::interp::Boolean::operator Ty ( ) const
inlineexplicit

Definition at line 49 of file Boolean.h.

References V.

◆ operator!=()

bool clang::interp::Boolean::operator!= ( Boolean  RHS) const
inline

Definition at line 40 of file Boolean.h.

References V.

◆ operator-() [1/2]

Boolean clang::interp::Boolean::operator- ( ) const
inline

Definition at line 44 of file Boolean.h.

References Boolean(), and V.

◆ operator-() [2/2]

Boolean clang::interp::Boolean::operator- ( const Boolean Other) const
inline

Definition at line 45 of file Boolean.h.

References Boolean(), clang::Other, and V.

◆ operator<()

bool clang::interp::Boolean::operator< ( Boolean  RHS) const
inline

Definition at line 35 of file Boolean.h.

References V.

◆ operator<=()

bool clang::interp::Boolean::operator<= ( Boolean  RHS) const
inline

Definition at line 37 of file Boolean.h.

References V.

◆ operator==()

bool clang::interp::Boolean::operator== ( Boolean  RHS) const
inline

Definition at line 39 of file Boolean.h.

References V.

◆ operator>() [1/2]

bool clang::interp::Boolean::operator> ( Boolean  RHS) const
inline

Definition at line 36 of file Boolean.h.

References V.

◆ operator>() [2/2]

bool clang::interp::Boolean::operator> ( unsigned  RHS) const
inline

Definition at line 42 of file Boolean.h.

References V.

◆ operator>=()

bool clang::interp::Boolean::operator>= ( Boolean  RHS) const
inline

Definition at line 38 of file Boolean.h.

References V.

◆ operator~()

Boolean clang::interp::Boolean::operator~ ( ) const
inline

Definition at line 46 of file Boolean.h.

References Boolean().

◆ print()

void clang::interp::Boolean::print ( llvm::raw_ostream &  OS) const
inline

Definition at line 82 of file Boolean.h.

References V.

Referenced by clang::interp::operator<<(), and toDiagnosticString().

◆ sub()

static bool clang::interp::Boolean::sub ( Boolean  A,
Boolean  B,
unsigned  OpBits,
Boolean R 
)
inlinestatic

Definition at line 130 of file Boolean.h.

References Boolean().

◆ toAPSInt() [1/2]

APSInt clang::interp::Boolean::toAPSInt ( ) const
inline

Definition at line 53 of file Boolean.h.

References V.

Referenced by toAPSInt(), and toAPValue().

◆ toAPSInt() [2/2]

APSInt clang::interp::Boolean::toAPSInt ( unsigned  NumBits) const
inline

Definition at line 56 of file Boolean.h.

References toAPSInt().

◆ toAPValue()

APValue clang::interp::Boolean::toAPValue ( const ASTContext ) const
inline

Definition at line 59 of file Boolean.h.

References toAPSInt().

◆ toDiagnosticString()

std::string clang::interp::Boolean::toDiagnosticString ( const ASTContext Ctx) const
inline

Definition at line 83 of file Boolean.h.

References print().

◆ toUnsigned()

Boolean clang::interp::Boolean::toUnsigned ( ) const
inline

Definition at line 61 of file Boolean.h.

◆ truncate()

Boolean clang::interp::Boolean::truncate ( unsigned  TruncBits) const
inline

Definition at line 80 of file Boolean.h.

◆ zero()

static Boolean clang::interp::Boolean::zero ( )
inlinestatic

Definition at line 105 of file Boolean.h.

References from().


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