| /llvm-project-15.0.7/llvm/unittests/ADT/ |
| H A D | APSIntTest.cpp | 17 APSInt A(32, true); in TEST() 20 APSInt B(128, false); in TEST() 24 APSInt C(B); in TEST() 29 APSInt D(std::move(Wide)); in TEST() 33 A = APSInt(64, true); in TEST() 186 APSInt False(APInt(1, 0), false); in TEST() 187 APSInt True(APInt(1, 1), false); in TEST() 229 APSInt False(APInt(1, 0)); in TEST() 230 APSInt True(APInt(1, 1)); in TEST() 231 APSInt CharMin(APInt(8, 0)); in TEST() [all …]
|
| H A D | StringExtrasTest.cpp | 267 EXPECT_EQ(toString(APSInt(APInt(8, 0), false), 2), "0"); in TEST() 268 EXPECT_EQ(toString(APSInt(APInt(8, 0), false), 8), "0"); in TEST() 269 EXPECT_EQ(toString(APSInt(APInt(8, 0), false), 10), "0"); in TEST() 270 EXPECT_EQ(toString(APSInt(APInt(8, 0), false), 16), "0"); in TEST() 274 EXPECT_EQ(toString(APSInt(APInt(8, 255), isUnsigned), 8), "377"); in TEST() 275 EXPECT_EQ(toString(APSInt(APInt(8, 255), isUnsigned), 10), "255"); in TEST() 276 EXPECT_EQ(toString(APSInt(APInt(8, 255), isUnsigned), 16), "FF"); in TEST() 279 EXPECT_EQ(toString(APSInt(APInt(8, 255), isUnsigned), 2), "-1"); in TEST() 280 EXPECT_EQ(toString(APSInt(APInt(8, 255), isUnsigned), 8), "-1"); in TEST() 281 EXPECT_EQ(toString(APSInt(APInt(8, 255), isUnsigned), 10), "-1"); in TEST() [all …]
|
| /llvm-project-15.0.7/llvm/include/llvm/ADT/ |
| H A D | APSInt.h | 112 const APSInt &operator%=(const APSInt &RHS) { 120 const APSInt &operator/=(const APSInt &RHS) { 128 APSInt operator%(const APSInt &RHS) const { 132 APSInt operator/(const APSInt &RHS) const { 219 APSInt& operator+=(const APSInt& RHS) { 224 APSInt& operator-=(const APSInt& RHS) { 229 APSInt& operator*=(const APSInt& RHS) { 234 APSInt& operator&=(const APSInt& RHS) { 239 APSInt& operator|=(const APSInt& RHS) { 244 APSInt& operator^=(const APSInt& RHS) { [all …]
|
| H A D | APFixedPoint.h | 114 APSInt getValue() const { return APSInt(Val, !Sema.isSigned()); } in getValue() 156 APSInt getIntPart() const { in getIntPart() 168 APSInt convertToInt(unsigned DstWidth, bool DstSign, 210 static APFixedPoint getFromIntValue(const APSInt &Value, 226 APSInt Val;
|
| /llvm-project-15.0.7/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ |
| H A D | RangedConstraintManager.h | 31 Range(const llvm::APSInt &From, const llvm::APSInt &To) : Impl(&From, &To) { in Range() 61 std::pair<const llvm::APSInt *, const llvm::APSInt *> Impl; 166 RangeSet unite(RangeSet Original, llvm::APSInt From, llvm::APSInt To); 173 RangeSet getRangeSet(const llvm::APSInt &From, const llvm::APSInt &To) { in getRangeSet() 197 RangeSet intersect(RangeSet What, llvm::APSInt Lower, llvm::APSInt Upper); 314 RangeSet(Factory &F, const llvm::APSInt &From, const llvm::APSInt &To) in RangeSet() 339 const llvm::APSInt &getMinValue() const; 394 bool pin(llvm::APSInt &Lower, llvm::APSInt &Upper) const; 395 bool pin(llvm::APSInt &Point) const; 468 const llvm::APSInt &To, const llvm::APSInt &Adjustment) = 0; [all …]
|
| H A D | BasicValueFactory.h | 143 const llvm::APSInt& getValue(const llvm::APSInt& X); 162 const llvm::APSInt &Convert(const llvm::APSInt& To, in Convert() 171 const llvm::APSInt &Convert(QualType T, const llvm::APSInt &From) { in Convert() 176 const llvm::APSInt &Convert(APSIntType TargetType, const llvm::APSInt &From) { in Convert() 188 const llvm::APSInt &getMaxValue(const llvm::APSInt &v) { in getMaxValue() 192 const llvm::APSInt &getMinValue(const llvm::APSInt &v) { in getMinValue() 212 const llvm::APSInt &Add1(const llvm::APSInt &V) { in Add1() 213 llvm::APSInt X = V; in Add1() 218 const llvm::APSInt &Sub1(const llvm::APSInt &V) { in Sub1() 219 llvm::APSInt X = V; in Sub1() [all …]
|
| H A D | APSIntType.h | 27 /* implicit */ APSIntType(const llvm::APSInt &Value) in APSIntType() 37 void apply(llvm::APSInt &Value) const { in apply() 48 llvm::APSInt convert(const llvm::APSInt &Value) const LLVM_READONLY { in convert() 49 llvm::APSInt Result(Value, Value.isUnsigned()); in convert() 55 llvm::APSInt getZeroValue() const LLVM_READONLY { in getZeroValue() 56 return llvm::APSInt(BitWidth, IsUnsigned); in getZeroValue() 60 llvm::APSInt getMinValue() const LLVM_READONLY { in getMinValue() 61 return llvm::APSInt::getMinValue(BitWidth, IsUnsigned); in getMinValue() 65 llvm::APSInt getMaxValue() const LLVM_READONLY { in getMaxValue() 66 return llvm::APSInt::getMaxValue(BitWidth, IsUnsigned); in getMaxValue() [all …]
|
| H A D | ConstraintManager.h | 27 class APSInt; variable 90 const llvm::APSInt &From, 91 const llvm::APSInt &To, bool InBound); 99 const llvm::APSInt &From, 100 const llvm::APSInt &To); 108 virtual const llvm::APSInt* getSymVal(ProgramStateRef state, in getSymVal() 151 const llvm::APSInt &From, 152 const llvm::APSInt &To,
|
| H A D | SimpleConstraintManager.h | 53 const llvm::APSInt &From, 54 const llvm::APSInt &To, 74 const llvm::APSInt &From, 75 const llvm::APSInt &To,
|
| /llvm-project-15.0.7/clang/unittests/Frontend/ |
| H A D | FixedPointString.cpp | 7 using llvm::APSInt; 14 FixedPointValueToString(S, APSInt::get(320), 7); in TEST() 18 FixedPointValueToString(S, APSInt::get(0), 7); in TEST() 23 FixedPointValueToString(S, APSInt::getMaxValue(16, /*Unsigned=*/false), 7); in TEST() 28 FixedPointValueToString(S, APSInt::getMaxValue(32, /*Unsigned=*/false), 15); in TEST() 33 FixedPointValueToString(S, APSInt::getMaxValue(64, /*Unsigned=*/false), 31); in TEST() 38 FixedPointValueToString(S, APSInt::getMaxValue(16, /*Unsigned=*/true), 8); in TEST() 53 FixedPointValueToString(S, APSInt::getMaxValue(8, /*Unsigned=*/false), 7); in TEST() 68 FixedPointValueToString(S, APSInt::getMaxValue(8, /*Unsigned=*/true), 8); in TEST() 84 FixedPointValueToString(S, APSInt::get(-320), 7); in TEST() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Support/ |
| H A D | APFixedPoint.cpp | 21 APSInt NewVal = Val; in convert() 65 APSInt ThisVal = getValue(); in compare() 185 APSInt Result; in add() 209 APSInt Result; in sub() 250 APSInt Result; in mul() 303 APSInt Result; in div() 337 APSInt ThisVal = Val; in shl() 371 APSInt Val = getValue(); in toString() 417 APSInt Result = getIntPart(); in convertToInt() 420 APSInt DstMin = APSInt::getMinValue(DstWidth, !DstSign); in convertToInt() [all …]
|
| H A D | APSInt.cpp | 21 APSInt::APSInt(StringRef Str) { in APSInt() function in APSInt 31 *this = APSInt(Tmp, /*isUnsigned=*/false); in APSInt() 37 *this = APSInt(Tmp, /*isUnsigned=*/true); in APSInt() 40 void APSInt::Profile(FoldingSetNodeID& ID) const { in Profile()
|
| /llvm-project-15.0.7/clang/lib/StaticAnalyzer/Core/ |
| H A D | RangeConstraintManager.cpp | 172 using llvm::APSInt; in unite() 392 bool RangeSet::pin(llvm::APSInt &Lower, llvm::APSInt &Upper) const { in pin() 714 using llvm::APSInt; in truncateTo() 728 APSInt ToInt = R.To(); in truncateTo() 780 using llvm::APSInt; in convertTo() 781 using Bounds = std::pair<const APSInt &, const APSInt &>; in convertTo() 787 APSInt ToInt = R.To(); in convertTo() 1864 const llvm::APSInt &To, const llvm::APSInt &Adjustment) override; 1868 const llvm::APSInt &To, const llvm::APSInt &Adjustment) override; 3148 const llvm::APSInt &To, const llvm::APSInt &Adjustment) { in assumeSymWithinInclusiveRange() [all …]
|
| H A D | RangedConstraintManager.cpp | 45 const llvm::APSInt &Zero = getBasicVals().getValue(0, SIE->getType()); in assumeSym() 68 const llvm::APSInt &Zero = getBasicVals().getValue(0, DiffTy); in assumeSym() 85 const llvm::APSInt &Zero = getBasicVals().getValue(0, ExprType); in assumeSym() 102 ProgramStateRef State, SymbolRef Sym, const llvm::APSInt &From, in assumeSymInclusiveRange() 103 const llvm::APSInt &To, bool InRange) { in assumeSymInclusiveRange() 111 llvm::APSInt Adjustment = WraparoundType.getZeroValue(); in assumeSymInclusiveRange() 117 llvm::APSInt ConvertedFrom = ComparisonType.convert(From); in assumeSymInclusiveRange() 118 llvm::APSInt ConvertedTo = ComparisonType.convert(To); in assumeSymInclusiveRange() 145 const llvm::APSInt &Zero = BVF.getValue(0, T); in assumeSymUnsupported() 181 llvm::APSInt Adjustment = WraparoundType.getZeroValue(); in assumeSymRel() [all …]
|
| H A D | SimpleSValBuilder.cpp | 114 const llvm::APSInt &RHS, in MakeSymIntVal() 181 const llvm::APSInt *ConvertedRHS = &RHS; in MakeSymIntVal() 261 static std::pair<SymbolRef, llvm::APSInt> 308 llvm::APSInt ResultInt; in doRearrangeUnchecked() 395 llvm::APSInt LInt, RInt; in tryRearrange() 514 llvm::APSInt RHSValue = *KnownRHSValue; in evalBinOpNN() 529 const llvm::APSInt *Result = in evalBinOpNN() 657 const llvm::APSInt *newRHS; in evalBinOpNN() 1097 const llvm::APSInt &leftI = lhsInt->getValue(); in evalBinOpLN() 1234 const llvm::APSInt *Const = in simplifySValOnce() [all …]
|
| H A D | BasicValueFactory.cpp | 84 I.getValue().~APSInt(); in ~BasicValueFactory() 90 const llvm::APSInt& BasicValueFactory::getValue(const llvm::APSInt& X) { in getValue() 94 using FoldNodeTy = llvm::FoldingSetNodeWrapper<llvm::APSInt>; in getValue() 108 const llvm::APSInt& BasicValueFactory::getValue(const llvm::APInt& X, in getValue() 110 llvm::APSInt V(X, isUnsigned); in getValue() 114 const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, unsigned BitWidth, in getValue() 116 llvm::APSInt V(BitWidth, isUnsigned); in getValue() 121 const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, QualType T) { in getValue() 249 const llvm::APSInt* 251 const llvm::APSInt& V1, const llvm::APSInt& V2) { in evalAPSInt()
|
| H A D | ConstraintManager.cpp | 102 const llvm::APSInt &From, in assumeInclusiveRangeDual() 103 const llvm::APSInt &To) { in assumeInclusiveRangeDual() 118 const llvm::APSInt &From, in assumeInclusiveRange() 119 const llvm::APSInt &To, bool InBound) { in assumeInclusiveRange()
|
| /llvm-project-15.0.7/llvm/lib/DebugInfo/CodeView/ |
| H A D | RecordSerialization.cpp | 36 Error llvm::codeview::consume(BinaryStreamReader &Reader, APSInt &Num) { in consume() 44 Num = APSInt(APInt(/*numBits=*/16, Short, /*isSigned=*/false), in consume() 54 Num = APSInt(APInt(8, N, true), false); in consume() 61 Num = APSInt(APInt(16, N, true), false); in consume() 68 Num = APSInt(APInt(16, N, false), true); in consume() 75 Num = APSInt(APInt(32, N, true), false); in consume() 82 Num = APSInt(APInt(32, N, FalseVal), true); in consume() 89 Num = APSInt(APInt(64, N, true), false); in consume() 96 Num = APSInt(APInt(64, N, false), true); in consume() 104 Error llvm::codeview::consume(StringRef &Data, APSInt &Num) { in consume() [all …]
|
| /llvm-project-15.0.7/clang/test/SemaCXX/ |
| H A D | unused.cpp | 11 class APSInt : public APInt { class 14 APSInt &operator=(const APSInt &RHS); 17 APSInt& APSInt::operator=(const APSInt &RHS) { in operator =()
|
| /llvm-project-15.0.7/clang-tools-extra/clang-tidy/misc/ |
| H A D | RedundantExpressionCheck.cpp | 37 using llvm::APSInt; 46 static bool incrementWithoutOverflow(const APSInt &Value, APSInt &Result) { in incrementWithoutOverflow() 170 APSInt ValueLhsPlus1; in areEquivalentRanges() 212 APSInt ValueLhsPlus1; in areExclusiveRanges() 251 APSInt ValueLhsPlus1; in rangesFullyCoverDomain() 676 Value = APSInt(32, false); in retrieveRelationalIntegerConstantExpr() 1013 APSInt LhsValue, RhsValue; in checkArithmeticExpr() 1090 APSInt LhsValue, RhsValue; in checkBitwiseExpr() 1120 APSInt Value; in checkBitwiseExpr() 1169 APSInt LhsValue, RhsValue; in checkRelationalExpr() [all …]
|
| /llvm-project-15.0.7/clang-tools-extra/clang-tidy/cppcoreguidelines/ |
| H A D | NarrowingConversionsCheck.cpp | 214 llvm::APSInt::compareValues(Upper, From.Upper) >= 0; in contains() 217 bool contains(const llvm::APSInt &Value) const { in contains() 218 return llvm::APSInt::compareValues(Lower, Value) <= 0 && in contains() 219 llvm::APSInt::compareValues(Upper, Value) >= 0; in contains() 222 llvm::APSInt Lower; 223 llvm::APSInt Upper; 279 llvm::APSInt Result = llvm::APSInt(DestWidth, !DestSigned); in isFloatExactlyRepresentable() 334 const llvm::APSInt &Value) { in diagNarrowIntegerConstant() 343 const llvm::APSInt &Value, const uint64_t HexBits) { in diagNarrowIntegerConstantToSignedInt() 399 llvm::APSInt IntegerConstant; in handleIntegralCast() [all …]
|
| /llvm-project-15.0.7/clang/include/clang/AST/ |
| H A D | APValue.h | 124 typedef llvm::APSInt APSInt; 261 APSInt Real, Imag; 322 APValue(APSInt R, APSInt I) : Kind(None) { 415 APSInt &getInt() { 417 return *(APSInt *)(char *)&Data; 419 const APSInt &getInt() const { 445 APSInt &getComplexIntReal() { 453 APSInt &getComplexIntImag() { 580 void setInt(APSInt I) { 597 void setComplexInt(APSInt R, APSInt I) { [all …]
|
| /llvm-project-15.0.7/clang-tools-extra/clang-tidy/bugprone/ |
| H A D | SuspiciousEnumUsageCheck.cpp | 37 llvm::APSInt MinVal; 38 llvm::APSInt MaxVal; 44 return llvm::APSInt::compareValues(E1->getInitVal(), in ValueRange() 60 return llvm::APSInt::compareValues(Range1.MaxVal, Range2.MinVal) < 0 || in hasDisjointValueRange() 61 llvm::APSInt::compareValues(Range2.MaxVal, Range1.MinVal) < 0; in hasDisjointValueRange() 65 llvm::APSInt Val = EnumConst->getInitVal(); in isNonPowerOf2NorNullLiteral()
|
| /llvm-project-15.0.7/clang/lib/AST/Interp/ |
| H A D | Integral.h | 28 using APSInt = llvm::APSInt; variable 80 explicit Integral(const APSInt &V) 106 APSInt toAPSInt() const { 107 return APSInt(APInt(Bits, static_cast<uint64_t>(V), Signed), !Signed); 109 APSInt toAPSInt(unsigned NumBits) const { 111 return APSInt(toAPSInt().sextOrTrunc(NumBits), !Signed); 113 return APSInt(toAPSInt().zextOrTrunc(NumBits), !Signed);
|
| /llvm-project-15.0.7/clang/lib/StaticAnalyzer/Checkers/ |
| H A D | UndefResultChecker.cpp | 70 const llvm::APSInt *LHS = SB.getKnownValue(State, C.getSVal(B->getLHS())); in isLeftShiftResultUnrepresentable() 71 const llvm::APSInt *RHS = SB.getKnownValue(State, C.getSVal(B->getRHS())); in isLeftShiftResultUnrepresentable() 138 const llvm::APSInt *I = in checkPostStmt() 158 const llvm::APSInt *LHS = in checkPostStmt() 160 const llvm::APSInt *RHS = in checkPostStmt()
|