clang 20.0.0git
|
Wrapper around numeric types. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/Interp/Integral.h"
Public Types | |
using | AsUnsigned = Integral< Bits, false > |
Public Member Functions | |
Integral () | |
Zero-initializes an integral. | |
template<unsigned SrcBits, bool SrcSign> | |
Integral (Integral< SrcBits, SrcSign > V) | |
Constructs an integral from another integral. | |
Integral (const APSInt &V) | |
Construct an integral from a value based on signedness. | |
bool | operator< (Integral RHS) const |
bool | operator> (Integral RHS) const |
bool | operator<= (Integral RHS) const |
bool | operator>= (Integral RHS) const |
bool | operator== (Integral RHS) const |
bool | operator!= (Integral RHS) const |
bool | operator> (unsigned RHS) const |
Integral | operator- () const |
Integral | operator- (const Integral &Other) const |
Integral | operator~ () const |
template<unsigned DstBits, bool DstSign> | |
operator Integral< DstBits, DstSign > () 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 |
Integral< Bits, false > | toUnsigned () const |
bool | isZero () const |
bool | isMin () const |
bool | isMinusOne () const |
bool | isNegative () const |
bool | isPositive () const |
ComparisonCategoryResult | compare (const Integral &RHS) const |
std::string | toDiagnosticString (const ASTContext &Ctx) const |
unsigned | countLeadingZeros () const |
Integral | truncate (unsigned TruncBits) const |
void | print (llvm::raw_ostream &OS) const |
Static Public Member Functions | |
static constexpr unsigned | bitWidth () |
static constexpr bool | isSigned () |
static Integral | min (unsigned NumBits) |
static Integral | max (unsigned NumBits) |
template<typename ValT > | |
static Integral | from (ValT Value) |
template<unsigned SrcBits, bool SrcSign> | |
static std::enable_if_t< SrcBits !=0, Integral > | from (Integral< SrcBits, SrcSign > Value) |
static Integral | zero () |
template<typename T > | |
static Integral | from (T Value, unsigned NumBits) |
static bool | inRange (int64_t Value, unsigned NumBits) |
static bool | increment (Integral A, Integral *R) |
static bool | decrement (Integral A, Integral *R) |
static bool | add (Integral A, Integral B, unsigned OpBits, Integral *R) |
static bool | sub (Integral A, Integral B, unsigned OpBits, Integral *R) |
static bool | mul (Integral A, Integral B, unsigned OpBits, Integral *R) |
static bool | rem (Integral A, Integral B, unsigned OpBits, Integral *R) |
static bool | div (Integral A, Integral B, unsigned OpBits, Integral *R) |
static bool | bitAnd (Integral A, Integral B, unsigned OpBits, Integral *R) |
static bool | bitOr (Integral A, Integral B, unsigned OpBits, Integral *R) |
static bool | bitXor (Integral A, Integral B, unsigned OpBits, Integral *R) |
static bool | neg (Integral A, Integral *R) |
static bool | comp (Integral A, Integral *R) |
template<unsigned RHSBits, bool RHSSign> | |
static void | shiftLeft (const Integral A, const Integral< RHSBits, RHSSign > B, unsigned OpBits, Integral *R) |
template<unsigned RHSBits, bool RHSSign> | |
static void | shiftRight (const Integral A, const Integral< RHSBits, RHSSign > B, unsigned OpBits, Integral *R) |
Friends | |
template<unsigned OtherBits, bool OtherSigned> | |
class | Integral |
Wrapper around numeric types.
These wrappers are required to shared an interface between APSint and builtin primitive numeral types, while optimising for storage and allowing methods operating on primitive type to compile to fast code.
Definition at line 50 of file Integral.h.
using clang::interp::Integral< Bits, Signed >::AsUnsigned = Integral<Bits, false> |
Definition at line 66 of file Integral.h.
|
inline |
Zero-initializes an integral.
Definition at line 69 of file Integral.h.
|
inlineexplicit |
Constructs an integral from another integral.
Definition at line 73 of file Integral.h.
|
inlineexplicit |
Construct an integral from a value based on signedness.
Definition at line 76 of file Integral.h.
|
inlinestatic |
Definition at line 200 of file Integral.h.
Referenced by clang::interp::Integral< Bits, Signed >::increment().
|
inlinestatic |
Definition at line 222 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral.
|
inlinestatic |
Definition at line 227 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral.
|
inlinestaticconstexpr |
Definition at line 121 of file Integral.h.
Referenced by clang::interp::Integral< Bits, Signed >::decrement(), clang::interp::Integral< Bits, Signed >::increment(), and clang::interp::Integral< Bits, Signed >::isMin().
|
inlinestatic |
Definition at line 232 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral.
|
inlinestatic |
Definition at line 245 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral.
|
inline |
Definition at line 134 of file Integral.h.
References clang::interp::Compare(), and V.
|
inline |
Definition at line 145 of file Integral.h.
References clang::Signed, and V.
|
inlinestatic |
Definition at line 196 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::bitWidth(), clang::interp::Integral< Bits, Signed >::Integral, and clang::interp::Integral< Bits, Signed >::sub().
|
inlinestatic |
Definition at line 217 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral.
|
inlinestatic |
Definition at line 178 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral.
|
inlinestatic |
Definition at line 184 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral.
|
inlinestatic |
Definition at line 169 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::from(), and clang::interp::Integral< Bits, Signed >::Integral.
Referenced by clang::interp::Integral< Bits, Signed >::from(), clang::interp::Integral< Bits, Signed >::shiftLeft(), clang::interp::Integral< Bits, Signed >::shiftRight(), and clang::interp::Integral< Bits, Signed >::zero().
|
inlinestatic |
Definition at line 192 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::add(), clang::interp::Integral< Bits, Signed >::bitWidth(), and clang::interp::Integral< Bits, Signed >::Integral.
|
inlinestatic |
Definition at line 188 of file Integral.h.
|
inline |
Definition at line 125 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::bitWidth(), and clang::interp::Integral< Bits, Signed >::min().
Referenced by clang::interp::Integral< Bits, Signed >::neg().
|
inline |
Definition at line 127 of file Integral.h.
References clang::Signed, and V.
|
inline |
Definition at line 131 of file Integral.h.
References V.
Referenced by clang::interp::Integral< Bits, Signed >::isPositive().
|
inline |
Definition at line 132 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::isNegative().
|
inlinestaticconstexpr |
Definition at line 129 of file Integral.h.
References clang::Signed.
|
inline |
Definition at line 123 of file Integral.h.
References V.
|
inlinestatic |
Definition at line 165 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral.
|
inlinestatic |
Definition at line 162 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral.
Referenced by clang::interp::Integral< Bits, Signed >::isMin().
|
inlinestatic |
Definition at line 208 of file Integral.h.
|
inlinestatic |
Definition at line 237 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::isMin(), and clang::Signed.
|
inlineexplicit |
Definition at line 97 of file Integral.h.
References V.
|
inlineexplicit |
Definition at line 102 of file Integral.h.
References V.
|
inline |
Definition at line 84 of file Integral.h.
References V.
|
inline |
Definition at line 90 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral, and V.
|
inline |
Definition at line 91 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral, clang::Other, and V.
|
inline |
Definition at line 79 of file Integral.h.
References V.
|
inline |
Definition at line 81 of file Integral.h.
References V.
|
inline |
Definition at line 83 of file Integral.h.
References V.
|
inline |
Definition at line 80 of file Integral.h.
References V.
|
inline |
Definition at line 86 of file Integral.h.
References V.
|
inline |
Definition at line 82 of file Integral.h.
References V.
|
inline |
Definition at line 94 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral, and V.
|
inline |
|
inlinestatic |
Definition at line 212 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral.
|
inlinestatic |
Definition at line 251 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::from().
|
inlinestatic |
Definition at line 257 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::from().
|
inlinestatic |
Definition at line 204 of file Integral.h.
Referenced by clang::interp::Integral< Bits, Signed >::decrement().
|
inline |
Definition at line 106 of file Integral.h.
References clang::Signed, and V.
Referenced by clang::interp::Integral< Bits, Signed >::toAPSInt(), and clang::interp::Integral< Bits, Signed >::toAPValue().
|
inline |
Definition at line 109 of file Integral.h.
References clang::Signed, and clang::interp::Integral< Bits, Signed >::toAPSInt().
|
inline |
Definition at line 115 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::toAPSInt().
|
inline |
Definition at line 138 of file Integral.h.
References V.
|
inline |
Definition at line 117 of file Integral.h.
|
inline |
Definition at line 151 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::Integral, clang::Signed, and V.
|
inlinestatic |
Definition at line 182 of file Integral.h.
References clang::interp::Integral< Bits, Signed >::from().
|
friend |
Definition at line 52 of file Integral.h.
Referenced by clang::interp::Integral< Bits, Signed >::bitAnd(), clang::interp::Integral< Bits, Signed >::bitOr(), clang::interp::Integral< Bits, Signed >::bitXor(), clang::interp::Integral< Bits, Signed >::comp(), clang::interp::Integral< Bits, Signed >::decrement(), clang::interp::Integral< Bits, Signed >::div(), clang::interp::Integral< Bits, Signed >::from(), clang::interp::Integral< Bits, Signed >::increment(), clang::interp::Integral< Bits, Signed >::max(), clang::interp::Integral< Bits, Signed >::min(), clang::interp::Integral< Bits, Signed >::operator-(), clang::interp::Integral< Bits, Signed >::operator~(), clang::interp::Integral< Bits, Signed >::rem(), and clang::interp::Integral< Bits, Signed >::truncate().