Lines Matching refs:IntRange
5584 struct IntRange { struct
5591 IntRange(unsigned Width, bool NonNegative) in IntRange() argument
5596 static IntRange forBoolType() { in forBoolType() argument
5597 return IntRange(1, true); in forBoolType()
5601 static IntRange forValueOfType(ASTContext &C, QualType T) { in forValueOfType() argument
5607 static IntRange forValueOfCanonicalType(ASTContext &C, const Type *T) { in forValueOfCanonicalType() argument
5621 return IntRange(C.getIntWidth(QualType(T, 0)), false); in forValueOfCanonicalType()
5627 return IntRange(NumPositive, true/*NonNegative*/); in forValueOfCanonicalType()
5629 return IntRange(std::max(NumPositive + 1, NumNegative), in forValueOfCanonicalType()
5636 return IntRange(C.getIntWidth(QualType(T, 0)), BT->isUnsignedInteger()); in forValueOfCanonicalType()
5644 static IntRange forTargetOfCanonicalType(ASTContext &C, const Type *T) { in forTargetOfCanonicalType() argument
5659 return IntRange(C.getIntWidth(QualType(T, 0)), BT->isUnsignedInteger()); in forTargetOfCanonicalType()
5663 static IntRange join(IntRange L, IntRange R) { in join() argument
5664 return IntRange(std::max(L.Width, R.Width), in join()
5669 static IntRange meet(IntRange L, IntRange R) { in meet() argument
5670 return IntRange(std::min(L.Width, R.Width), in meet()
5675 static IntRange GetValueRange(ASTContext &C, llvm::APSInt &value, in GetValueRange()
5678 return IntRange(value.getMinSignedBits(), false); in GetValueRange()
5685 return IntRange(value.getActiveBits(), true); in GetValueRange()
5688 static IntRange GetValueRange(ASTContext &C, APValue &result, QualType Ty, in GetValueRange()
5694 IntRange R = GetValueRange(C, result.getVectorElt(0), Ty, MaxWidth); in GetValueRange()
5696 IntRange El = GetValueRange(C, result.getVectorElt(i), Ty, MaxWidth); in GetValueRange()
5697 R = IntRange::join(R, El); in GetValueRange()
5703 IntRange R = GetValueRange(C, result.getComplexIntReal(), MaxWidth); in GetValueRange()
5704 IntRange I = GetValueRange(C, result.getComplexIntImag(), MaxWidth); in GetValueRange()
5705 return IntRange::join(R, I); in GetValueRange()
5714 return IntRange(MaxWidth, Ty->isUnsignedIntegerOrEnumerationType()); in GetValueRange()
5728 static IntRange GetExprRange(ASTContext &C, Expr *E, unsigned MaxWidth) { in GetExprRange()
5743 IntRange OutputTypeRange = IntRange::forValueOfType(C, GetExprType(CE)); in GetExprRange()
5751 IntRange SubRange in GetExprRange()
5761 return IntRange(SubRange.Width, in GetExprRange()
5774 IntRange L = GetExprRange(C, CO->getTrueExpr(), MaxWidth); in GetExprRange()
5775 IntRange R = GetExprRange(C, CO->getFalseExpr(), MaxWidth); in GetExprRange()
5776 return IntRange::join(L, R); in GetExprRange()
5791 return IntRange::forBoolType(); in GetExprRange()
5803 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
5814 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
5819 return IntRange::meet(GetExprRange(C, BO->getLHS(), MaxWidth), in GetExprRange()
5829 IntRange R = IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
5830 return IntRange(R.Width, /*NonNegative*/ true); in GetExprRange()
5836 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
5841 IntRange L = GetExprRange(C, BO->getLHS(), MaxWidth); in GetExprRange()
5865 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
5873 IntRange L = GetExprRange(C, BO->getLHS(), opWidth); in GetExprRange()
5887 IntRange R = GetExprRange(C, BO->getRHS(), opWidth); in GetExprRange()
5888 return IntRange(L.Width, L.NonNegative && R.NonNegative); in GetExprRange()
5896 IntRange L = GetExprRange(C, BO->getLHS(), opWidth); in GetExprRange()
5897 IntRange R = GetExprRange(C, BO->getRHS(), opWidth); in GetExprRange()
5899 IntRange meet = IntRange::meet(L, R); in GetExprRange()
5914 IntRange L = GetExprRange(C, BO->getLHS(), MaxWidth); in GetExprRange()
5915 IntRange R = GetExprRange(C, BO->getRHS(), MaxWidth); in GetExprRange()
5916 return IntRange::join(L, R); in GetExprRange()
5923 return IntRange::forBoolType(); in GetExprRange()
5928 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
5939 return IntRange(BitField->getBitWidthValue(C), in GetExprRange()
5942 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
5945 static IntRange GetExprRange(ASTContext &C, Expr *E) { in GetExprRange()
6057 IntRange OtherRange = IntRange::forValueOfType(S.Context, OtherT); in DiagnoseOutOfRangeComparison()
6326 IntRange signedRange = GetExprRange(S.Context, signedOperand); in AnalyzeComparison()
6345 IntRange unsignedRange = GetExprRange(S.Context, unsignedOperand); in AnalyzeComparison()
6494 std::string PrettyPrintInRange(const llvm::APSInt &Value, IntRange Range) { in PrettyPrintInRange()
6730 IntRange SourceRange = GetExprRange(S.Context, E); in CheckImplicitConversion()
6731 IntRange TargetRange = IntRange::forTargetOfCanonicalType(S.Context, Target); in CheckImplicitConversion()