Lines Matching refs:IntRange
2396 struct IntRange { struct
2403 IntRange(unsigned Width, bool NonNegative) in IntRange() function
2408 static IntRange forBoolType() { in forBoolType() argument
2409 return IntRange(1, true); in forBoolType()
2413 static IntRange forValueOfType(ASTContext &C, QualType T) { in forValueOfType() argument
2419 static IntRange forValueOfCanonicalType(ASTContext &C, const Type *T) { in forValueOfCanonicalType() argument
2431 return IntRange(C.getIntWidth(QualType(T, 0)), false); in forValueOfCanonicalType()
2436 return IntRange(std::max(NumPositive, NumNegative), NumNegative == 0); in forValueOfCanonicalType()
2442 return IntRange(C.getIntWidth(QualType(T, 0)), BT->isUnsignedInteger()); in forValueOfCanonicalType()
2450 static IntRange forTargetOfCanonicalType(ASTContext &C, const Type *T) { in forTargetOfCanonicalType() argument
2463 return IntRange(C.getIntWidth(QualType(T, 0)), BT->isUnsignedInteger()); in forTargetOfCanonicalType()
2467 static IntRange join(IntRange L, IntRange R) { in join() argument
2468 return IntRange(std::max(L.Width, R.Width), in join()
2473 static IntRange meet(IntRange L, IntRange R) { in meet() argument
2474 return IntRange(std::min(L.Width, R.Width), in meet()
2479 IntRange GetValueRange(ASTContext &C, llvm::APSInt &value, unsigned MaxWidth) { in GetValueRange()
2481 return IntRange(value.getMinSignedBits(), false); in GetValueRange()
2488 return IntRange(value.getActiveBits(), true); in GetValueRange()
2491 IntRange GetValueRange(ASTContext &C, APValue &result, QualType Ty, in GetValueRange()
2497 IntRange R = GetValueRange(C, result.getVectorElt(0), Ty, MaxWidth); in GetValueRange()
2499 IntRange El = GetValueRange(C, result.getVectorElt(i), Ty, MaxWidth); in GetValueRange()
2500 R = IntRange::join(R, El); in GetValueRange()
2506 IntRange R = GetValueRange(C, result.getComplexIntReal(), MaxWidth); in GetValueRange()
2507 IntRange I = GetValueRange(C, result.getComplexIntImag(), MaxWidth); in GetValueRange()
2508 return IntRange::join(R, I); in GetValueRange()
2517 return IntRange(MaxWidth, Ty->isUnsignedIntegerOrEnumerationType()); in GetValueRange()
2524 IntRange GetExprRange(ASTContext &C, Expr *E, unsigned MaxWidth) { in GetExprRange()
2539 IntRange OutputTypeRange = IntRange::forValueOfType(C, CE->getType()); in GetExprRange()
2547 IntRange SubRange in GetExprRange()
2557 return IntRange(SubRange.Width, in GetExprRange()
2570 IntRange L = GetExprRange(C, CO->getTrueExpr(), MaxWidth); in GetExprRange()
2571 IntRange R = GetExprRange(C, CO->getFalseExpr(), MaxWidth); in GetExprRange()
2572 return IntRange::join(L, R); in GetExprRange()
2587 return IntRange::forBoolType(); in GetExprRange()
2599 return IntRange::forValueOfType(C, E->getType()); in GetExprRange()
2610 return IntRange::forValueOfType(C, E->getType()); in GetExprRange()
2615 return IntRange::meet(GetExprRange(C, BO->getLHS(), MaxWidth), in GetExprRange()
2625 IntRange R = IntRange::forValueOfType(C, E->getType()); in GetExprRange()
2626 return IntRange(R.Width, /*NonNegative*/ true); in GetExprRange()
2632 return IntRange::forValueOfType(C, E->getType()); in GetExprRange()
2637 IntRange L = GetExprRange(C, BO->getLHS(), MaxWidth); in GetExprRange()
2661 return IntRange::forValueOfType(C, E->getType()); in GetExprRange()
2669 IntRange L = GetExprRange(C, BO->getLHS(), opWidth); in GetExprRange()
2683 IntRange R = GetExprRange(C, BO->getRHS(), opWidth); in GetExprRange()
2684 return IntRange(L.Width, L.NonNegative && R.NonNegative); in GetExprRange()
2692 IntRange L = GetExprRange(C, BO->getLHS(), opWidth); in GetExprRange()
2693 IntRange R = GetExprRange(C, BO->getRHS(), opWidth); in GetExprRange()
2695 IntRange meet = IntRange::meet(L, R); in GetExprRange()
2710 IntRange L = GetExprRange(C, BO->getLHS(), MaxWidth); in GetExprRange()
2711 IntRange R = GetExprRange(C, BO->getRHS(), MaxWidth); in GetExprRange()
2712 return IntRange::join(L, R); in GetExprRange()
2719 return IntRange::forBoolType(); in GetExprRange()
2724 return IntRange::forValueOfType(C, E->getType()); in GetExprRange()
2732 IntRange::forValueOfType(C, E->getType()); in GetExprRange()
2740 return IntRange(BitWidth, in GetExprRange()
2744 return IntRange::forValueOfType(C, E->getType()); in GetExprRange()
2747 IntRange GetExprRange(ASTContext &C, Expr *E) { in GetExprRange()
2891 IntRange signedRange = GetExprRange(S.Context, signedOperand); in AnalyzeComparison()
2910 IntRange unsignedRange = GetExprRange(S.Context, unsignedOperand); in AnalyzeComparison()
3047 std::string PrettyPrintInRange(const llvm::APSInt &Value, IntRange Range) { in PrettyPrintInRange()
3168 IntRange SourceRange = GetExprRange(S.Context, E); in CheckImplicitConversion()
3169 IntRange TargetRange = IntRange::forTargetOfCanonicalType(S.Context, Target); in CheckImplicitConversion()