10 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_APSINTTYPE_H
11 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_APSINTTYPE_H
13 #include "llvm/ADT/APSInt.h"
26 : BitWidth(Width), IsUnsigned(Unsigned) {}
41 Value = Value.extOrTrunc(BitWidth);
42 Value.setIsUnsigned(IsUnsigned);
49 llvm::APSInt
convert(
const llvm::APSInt &
Value)
const LLVM_READONLY {
57 return llvm::APSInt(BitWidth, IsUnsigned);
62 return llvm::APSInt::getMinValue(BitWidth, IsUnsigned);
67 return llvm::APSInt::getMaxValue(BitWidth, IsUnsigned);
70 llvm::APSInt
getValue(uint64_t RawValue)
const LLVM_READONLY {
71 return (llvm::APSInt(BitWidth, IsUnsigned) = RawValue);
90 bool AllowMixedSign)
const LLVM_READONLY;
93 return BitWidth == Other.BitWidth && IsUnsigned == Other.IsUnsigned;
101 return std::tie(BitWidth, IsUnsigned) <
102 std::tie(Other.BitWidth, Other.IsUnsigned);
Value is less than the minimum representable value.
uint32_t getBitWidth() const
APSIntType(const llvm::APSInt &Value)
Value is representable using this type.
A record of the "type" of an APSInt, used for conversions.
APSIntType(uint32_t Width, bool Unsigned)
RangeTestResultKind testInRange(const llvm::APSInt &Val, bool AllowMixedSign) const LLVM_READONLY
Tests whether a given value is losslessly representable using this type.
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.
bool operator<(const APSIntType &Other) const
Provide an ordering for finding a common conversion type.
The result type of a method or function.
llvm::APSInt getMaxValue() const LLVM_READONLY
Returns the maximum value for this type.
Value is greater than the maximum representable value.
RangeTestResultKind
Used to classify whether a value is representable using this type.
llvm::APSInt getValue(uint64_t RawValue) const LLVM_READONLY
llvm::APSInt convert(const llvm::APSInt &Value) const LLVM_READONLY
Convert and return a new APSInt with the given value, but this type's bit width and signedness...
void apply(llvm::APSInt &Value) const
Convert a given APSInt, in place, to match this type.
bool operator==(const APSIntType &Other) const