Lines Matching refs:IntRange
6076 struct IntRange { struct
6083 IntRange(unsigned Width, bool NonNegative) in IntRange() argument
6088 static IntRange forBoolType() { in forBoolType() argument
6089 return IntRange(1, true); in forBoolType()
6093 static IntRange forValueOfType(ASTContext &C, QualType T) { in forValueOfType() argument
6099 static IntRange forValueOfCanonicalType(ASTContext &C, const Type *T) { in forValueOfCanonicalType() argument
6113 return IntRange(C.getIntWidth(QualType(T, 0)), false); in forValueOfCanonicalType()
6119 return IntRange(NumPositive, true/*NonNegative*/); in forValueOfCanonicalType()
6121 return IntRange(std::max(NumPositive + 1, NumNegative), in forValueOfCanonicalType()
6128 return IntRange(C.getIntWidth(QualType(T, 0)), BT->isUnsignedInteger()); in forValueOfCanonicalType()
6136 static IntRange forTargetOfCanonicalType(ASTContext &C, const Type *T) { in forTargetOfCanonicalType() argument
6151 return IntRange(C.getIntWidth(QualType(T, 0)), BT->isUnsignedInteger()); in forTargetOfCanonicalType()
6155 static IntRange join(IntRange L, IntRange R) { in join() argument
6156 return IntRange(std::max(L.Width, R.Width), in join()
6161 static IntRange meet(IntRange L, IntRange R) { in meet() argument
6162 return IntRange(std::min(L.Width, R.Width), in meet()
6167 static IntRange GetValueRange(ASTContext &C, llvm::APSInt &value, in GetValueRange()
6170 return IntRange(value.getMinSignedBits(), false); in GetValueRange()
6177 return IntRange(value.getActiveBits(), true); in GetValueRange()
6180 static IntRange GetValueRange(ASTContext &C, APValue &result, QualType Ty, in GetValueRange()
6186 IntRange R = GetValueRange(C, result.getVectorElt(0), Ty, MaxWidth); in GetValueRange()
6188 IntRange El = GetValueRange(C, result.getVectorElt(i), Ty, MaxWidth); in GetValueRange()
6189 R = IntRange::join(R, El); in GetValueRange()
6195 IntRange R = GetValueRange(C, result.getComplexIntReal(), MaxWidth); in GetValueRange()
6196 IntRange I = GetValueRange(C, result.getComplexIntImag(), MaxWidth); in GetValueRange()
6197 return IntRange::join(R, I); in GetValueRange()
6206 return IntRange(MaxWidth, Ty->isUnsignedIntegerOrEnumerationType()); in GetValueRange()
6220 static IntRange GetExprRange(ASTContext &C, Expr *E, unsigned MaxWidth) { in GetExprRange()
6235 IntRange OutputTypeRange = IntRange::forValueOfType(C, GetExprType(CE)); in GetExprRange()
6243 IntRange SubRange in GetExprRange()
6253 return IntRange(SubRange.Width, in GetExprRange()
6266 IntRange L = GetExprRange(C, CO->getTrueExpr(), MaxWidth); in GetExprRange()
6267 IntRange R = GetExprRange(C, CO->getFalseExpr(), MaxWidth); in GetExprRange()
6268 return IntRange::join(L, R); in GetExprRange()
6283 return IntRange::forBoolType(); in GetExprRange()
6295 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
6306 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
6311 return IntRange::meet(GetExprRange(C, BO->getLHS(), MaxWidth), in GetExprRange()
6321 IntRange R = IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
6322 return IntRange(R.Width, /*NonNegative*/ true); in GetExprRange()
6328 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
6333 IntRange L = GetExprRange(C, BO->getLHS(), MaxWidth); in GetExprRange()
6357 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
6365 IntRange L = GetExprRange(C, BO->getLHS(), opWidth); in GetExprRange()
6379 IntRange R = GetExprRange(C, BO->getRHS(), opWidth); in GetExprRange()
6380 return IntRange(L.Width, L.NonNegative && R.NonNegative); in GetExprRange()
6388 IntRange L = GetExprRange(C, BO->getLHS(), opWidth); in GetExprRange()
6389 IntRange R = GetExprRange(C, BO->getRHS(), opWidth); in GetExprRange()
6391 IntRange meet = IntRange::meet(L, R); in GetExprRange()
6406 IntRange L = GetExprRange(C, BO->getLHS(), MaxWidth); in GetExprRange()
6407 IntRange R = GetExprRange(C, BO->getRHS(), MaxWidth); in GetExprRange()
6408 return IntRange::join(L, R); in GetExprRange()
6415 return IntRange::forBoolType(); in GetExprRange()
6420 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
6431 return IntRange(BitField->getBitWidthValue(C), in GetExprRange()
6434 return IntRange::forValueOfType(C, GetExprType(E)); in GetExprRange()
6437 static IntRange GetExprRange(ASTContext &C, Expr *E) { in GetExprRange()
6549 IntRange OtherRange = IntRange::forValueOfType(S.Context, OtherT); in DiagnoseOutOfRangeComparison()
6818 IntRange signedRange = GetExprRange(S.Context, signedOperand); in AnalyzeComparison()
6837 IntRange unsignedRange = GetExprRange(S.Context, unsignedOperand); in AnalyzeComparison()
6986 std::string PrettyPrintInRange(const llvm::APSInt &Value, IntRange Range) { in PrettyPrintInRange()
7332 IntRange SourceRange = GetExprRange(S.Context, E); in CheckImplicitConversion()
7333 IntRange TargetRange = IntRange::forTargetOfCanonicalType(S.Context, Target); in CheckImplicitConversion()