clang API Documentation
A record of the "type" of an APSInt, used for conversions. More...
#include <APSIntType.h>
Public Types | |
| enum | RangeTestResultKind { RTR_Below = -1, RTR_Within = 0, RTR_Above = 1 } |
Public Member Functions | |
| APSIntType (uint32_t Width, bool Unsigned) | |
| APSIntType (const llvm::APSInt &Value) | |
| uint32_t | getBitWidth () const |
| bool | isUnsigned () const |
| void | apply (llvm::APSInt &Value) const |
| Convert a given APSInt, in place, to match this type. | |
| llvm::APSInt | convert (const llvm::APSInt &Value) const LLVM_READONLY |
| llvm::APSInt | getZeroValue () const LLVM_READONLY |
| Returns an all-zero value for this type. | |
| llvm::APSInt | getMinValue () const LLVM_READONLY |
| Returns the minimum value for this type. | |
| llvm::APSInt | getMaxValue () const LLVM_READONLY |
| Returns the maximum value for this type. | |
| llvm::APSInt | getValue (uint64_t RawValue) const LLVM_READONLY |
| RangeTestResultKind | testInRange (const llvm::APSInt &Val, bool AllowMixedSign) const LLVM_READONLY |
| bool | operator== (const APSIntType &Other) const |
| bool | operator< (const APSIntType &Other) const |
| Provide an ordering for finding a common conversion type. | |
A record of the "type" of an APSInt, used for conversions.
Definition at line 20 of file APSIntType.h.
Used to classify whether a value is representable using this type.
| RTR_Below |
Value is less than the minimum representable value. |
| RTR_Within |
Value is representable using this type. |
| RTR_Above |
Value is greater than the maximum representable value. |
Definition at line 77 of file APSIntType.h.
| clang::ento::APSIntType::APSIntType | ( | uint32_t | Width, |
| bool | Unsigned | ||
| ) | [inline] |
Definition at line 25 of file APSIntType.h.
| clang::ento::APSIntType::APSIntType | ( | const llvm::APSInt & | Value | ) | [inline] |
Definition at line 28 of file APSIntType.h.
| void clang::ento::APSIntType::apply | ( | llvm::APSInt & | Value | ) | const [inline] |
Convert a given APSInt, in place, to match this type.
This behaves like a C cast: converting 255u8 (0xFF) to s16 gives 255 (0x00FF), and converting -1s8 (0xFF) to u16 gives 65535 (0xFFFF).
Definition at line 38 of file APSIntType.h.
Referenced by convert().
| llvm::APSInt clang::ento::APSIntType::convert | ( | const llvm::APSInt & | Value | ) | const [inline] |
Convert and return a new APSInt with the given value, but this type's bit width and signedness.
Definition at line 49 of file APSIntType.h.
References apply().
Referenced by clang::ento::SimpleConstraintManager::assumeSymRel(), clang::ento::computeAdjustment(), and clang::ento::BasicValueFactory::Convert().
| uint32_t clang::ento::APSIntType::getBitWidth | ( | ) | const [inline] |
Definition at line 31 of file APSIntType.h.
Referenced by clang::ento::SimpleConstraintManager::assumeSymRel().
| llvm::APSInt clang::ento::APSIntType::getMaxValue | ( | ) | const [inline] |
Returns the maximum value for this type.
Definition at line 66 of file APSIntType.h.
| llvm::APSInt clang::ento::APSIntType::getMinValue | ( | ) | const [inline] |
Returns the minimum value for this type.
Definition at line 61 of file APSIntType.h.
| llvm::APSInt clang::ento::APSIntType::getValue | ( | uint64_t | RawValue | ) | const [inline] |
Definition at line 70 of file APSIntType.h.
| llvm::APSInt clang::ento::APSIntType::getZeroValue | ( | ) | const [inline] |
Returns an all-zero value for this type.
Definition at line 56 of file APSIntType.h.
Referenced by clang::ento::SimpleConstraintManager::assumeSymRel().
| bool clang::ento::APSIntType::isUnsigned | ( | ) | const [inline] |
Definition at line 32 of file APSIntType.h.
Referenced by clang::ento::SimpleConstraintManager::assumeSymRel().
| bool clang::ento::APSIntType::operator< | ( | const APSIntType & | Other | ) | const [inline] |
Provide an ordering for finding a common conversion type.
Unsigned integers are considered to be better conversion types than signed integers of the same width.
Definition at line 100 of file APSIntType.h.
| bool clang::ento::APSIntType::operator== | ( | const APSIntType & | Other | ) | const [inline] |
Definition at line 92 of file APSIntType.h.
| APSIntType::RangeTestResultKind APSIntType::testInRange | ( | const llvm::APSInt & | Val, |
| bool | AllowMixedSign | ||
| ) | const |
Tests whether a given value is losslessly representable using this type.
| Val | The value to test. |
| AllowMixedSign | Whether or not to allow signedness conversions. This determines whether -1s8 is considered in range for 'unsigned char' (u8). |
Definition at line 16 of file APSIntType.cpp.
References RTR_Above, RTR_Below, and RTR_Within.