Lines Matching refs:Unsigned
107 unsigned ByteNo) const {
114 static bool checkArgCount(Sema &S, CallExpr *call, unsigned desiredArgCount) {
115 unsigned argCount = call->getNumArgs();
211 static bool SemaBuiltinAlignment(Sema &S, CallExpr *TheCall, unsigned ID) {
242 unsigned MaxAlignmentBits = S.Context.getIntWidth(SrcTy) - 1;
290 unsigned BuiltinID) {
295 for (unsigned I = 0; I < 2; ++I) {
331 for (unsigned I = 0; I < 3; ++I) {
421 const char *, unsigned SpecifierLen) override {
603 unsigned BuiltinID = FD->getBuiltinID(/*ConsiderWrappers=*/true);
608 unsigned SizeTypeWidth = TI.getTypeWidth(TI.getSizeType());
610 unsigned DiagID = 0;
613 unsigned SizeIndex, ObjectIndex;
781 unsigned DiagID) {
812 unsigned ArgCounter = 0;
894 unsigned Start, unsigned
896 for (unsigned I = Start; I <= End; ++I)
906 unsigned NumNonVarArgs) {
909 unsigned NumBlockParams =
911 unsigned TotalNumArgs = TheCall->getNumArgs();
953 unsigned NumArgs = TheCall->getNumArgs();
1128 static bool checkOpenCLPipePacketType(Sema &S, CallExpr *Call, unsigned Idx) {
1277 static bool SemaOpenCLBuiltinToAddr(Sema &S, unsigned BuiltinID,
1339 auto DiagSelect = [&]() -> llvm::Optional<unsigned> {
1346 return llvm::Optional<unsigned>{};
1381 CheckBuiltinTargetSupport(Sema &S, unsigned BuiltinID, CallExpr *TheCall,
1395 bool Sema::CheckTSBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
1440 Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
1445 unsigned ICEArguments = 0;
1452 for (unsigned ArgNo = 0; ICEArguments != 0; ++ArgNo) {
2013 static unsigned RFT(unsigned t, bool shift = false, bool ForceQuad = false) {
2087 bool Sema::CheckSVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
2209 unsigned BuiltinID, CallExpr *TheCall) {
2212 unsigned TV = 0;
2224 unsigned ImmArg = TheCall->getNumArgs()-1;
2264 unsigned i = 0, l = 0, u = 0;
2277 bool Sema::CheckMVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
2285 bool Sema::CheckCDEBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
2323 bool Sema::CheckARMBuiltinExclusiveCall(unsigned BuiltinID, CallExpr *TheCall,
2324 unsigned MaxWidth) {
2438 bool Sema::CheckARMBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
2515 unsigned BuiltinID,
2569 unsigned i = 0, l = 0, u = 0;
2681 bool Sema::CheckBPFBuiltinFunctionCall(unsigned BuiltinID,
2745 bool Sema::CheckHexagonBuiltinArgument(unsigned BuiltinID, CallExpr *TheCall) {
2753 unsigned BuiltinID;
2970 unsigned M = 1 << A.Align;
2980 bool Sema::CheckHexagonBuiltinFunctionCall(unsigned BuiltinID,
2986 unsigned BuiltinID, CallExpr *TheCall) {
2991 bool Sema::CheckMipsBuiltinCpu(const TargetInfo &TI, unsigned BuiltinID,
3025 bool Sema::CheckMipsBuiltinArgument(unsigned BuiltinID, CallExpr *TheCall) {
3026 unsigned i = 0, l = 0, u = 0, m = 0;
3038 // These intrinsics take an unsigned 3 bit immediate.
3051 // These intrinsics take an unsigned 4 bit immediate.
3064 // These intrinsics take an unsigned 5 bit immediate.
3065 // The first block of intrinsics actually have an unsigned 5 bit field,
3105 // These intrinsics take an unsigned 6 bit immediate.
3139 // These intrinsics take an unsigned 8 bit immediate.
3151 // These intrinsics take an unsigned 4 bit immediate.
3157 // These intrinsics take an unsigned 3 bit immediate.
3163 // These intrinsics take an unsigned 2 bit immediate.
3169 // These intrinsics take an unsigned 1 bit immediate.
3209 unsigned &Mask) {
3218 unsigned size = strtoul(Str, &End, 10);
3226 unsigned size = strtoul(Str, &End, 10);
3258 bool Sema::CheckPPCBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
3260 unsigned i = 0, l = 0, u = 0;
3322 unsigned Width = Context.getIntWidth(EltTy);
3359 bool Sema::CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID,
3362 unsigned OrderIndex, ScopeIndex;
3420 bool Sema::CheckRISCVLMUL(CallExpr *TheCall, unsigned ArgNum) {
3441 unsigned BuiltinID,
3486 bool Sema::CheckSystemZBuiltinFunctionCall(unsigned BuiltinID,
3498 unsigned i = 0, l = 0, u = 0;
3592 bool Sema::CheckX86BuiltinRoundingOrSAE(unsigned BuiltinID, CallExpr *TheCall) {
3596 unsigned ArgNum = 0;
3797 bool Sema::CheckX86BuiltinGatherScatterScale(unsigned BuiltinID,
3799 unsigned ArgNum = 0;
3941 bool Sema::CheckX86BuiltinTileArguments(unsigned BuiltinID, CallExpr *TheCall) {
3958 static bool isX86_32Builtin(unsigned BuiltinID) {
3969 bool Sema::CheckX86BuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
4394 bool Sema::GetFormatNSStringIdx(const FormatAttr *Format, unsigned &Idx) {
4410 unsigned NumArgs) {
4411 unsigned Idx = 0;
4478 unsigned IdxAST = Idx.getASTIndex();
4497 unsigned ParamIndex = 0;
4529 unsigned Index = 0;
4544 for (unsigned ArgIndex = 0, ArgIndexEnd = NonNullArgs.size();
4617 unsigned NumParams = Proto ? Proto->getNumParams()
4624 for (unsigned ArgIdx = NumParams; ArgIdx < Args.size(); ++ArgIdx) {
4653 const auto N = std::min<unsigned>(Proto->getNumParams(), Args.size());
4654 for (unsigned ArgIdx = 0; ArgIdx < N; ++ArgIdx) {
4715 unsigned NumArgs = TheCall->getNumArgs();
4763 unsigned CMId = FDecl->getMemoryFunctionKind();
4918 const unsigned NumForm = GNUCmpXchg + 1;
4919 const unsigned NumArgs[] = { 2, 2, 3, 3, 3, 3, 4, 5, 6 };
4920 const unsigned NumVals[] = { 1, 0, 1, 1, 1, 1, 2, 2, 3 };
5030 unsigned AdjustedNumArgs = NumArgs[Form];
5036 << 0 << AdjustedNumArgs << static_cast<unsigned>(Args.size())
5042 << 0 << AdjustedNumArgs << static_cast<unsigned>(Args.size())
5216 for (unsigned i = 0; i != APIOrderedArgs.size(); ++i) {
5371 static bool checkBuiltinArgument(Sema &S, CallExpr *E, unsigned ArgIndex) {
5470 static const unsigned BuiltinIndices[][5] = {
5494 unsigned SizeIndex;
5511 unsigned BuiltinID = FDecl->getBuiltinID();
5512 unsigned BuiltinIndex, NumFixed = 1;
5696 unsigned NewBuiltinID = BuiltinIndices[BuiltinIndex][SizeIndex];
5715 for (unsigned i = 0; i != NumFixed; ++i) {
5777 unsigned BuiltinID = FDecl->getBuiltinID();
5782 unsigned numArgs = isStore ? 2 : 1;
5854 unsigned NumBytes = String.size();
5897 static bool checkVAStartABI(Sema &S, unsigned BuiltinID, Expr *Fn) {
5973 bool Sema::SemaBuiltinVAStart(unsigned BuiltinID, CallExpr *TheCall) {
6028 unsigned Reason = 0;
6128 bool Sema::SemaBuiltinFPClassification(CallExpr *TheCall, unsigned NumArgs) {
6134 for (unsigned i = 0; i < NumArgs - 1; ++i) {
6176 for (unsigned I = 0; I != 2; ++I) {
6233 unsigned ExpectedNumArgs = 3;
6287 unsigned numElements = 0;
6302 unsigned numResElements = TheCall->getNumArgs() - 2;
6328 for (unsigned i = 2; i < TheCall->getNumArgs(); i++) {
6352 for (unsigned i = 0, e = TheCall->getNumArgs(); i != e; i++) {
6380 unsigned SrcElts = SrcTy->castAs<VectorType>()->getNumElements();
6381 unsigned DstElts = DstTy->castAs<VectorType>()->getNumElements();
6396 unsigned NumArgs = TheCall->getNumArgs();
6405 for (unsigned i = 1; i != NumArgs; ++i)
6451 << (unsigned)Context.getCharWidth() << Arg->getSourceRange();
6464 unsigned NumArgs = TheCall->getNumArgs();
6502 unsigned BuiltinID =
6506 unsigned NumArgs = TheCall->getNumArgs();
6507 unsigned NumRequiredArgs = IsSizeCall ? 1 : 2;
6519 unsigned i = 0;
6534 unsigned FormatIdx = i;
6544 unsigned FirstDataArg = i;
6635 unsigned Num) {
6703 unsigned ArgBits) {
6733 unsigned ArgBits) {
6760 bool Sema::SemaBuiltinARMMemoryTaggingCall(unsigned BuiltinID, CallExpr *TheCall) {
6915 bool Sema::SemaBuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall,
6916 int ArgNum, unsigned ExpectedFieldNum,
6983 for (unsigned i=0; i<Fields.size(); ++i) {
7022 unsigned Mask = 0;
7023 unsigned ArgNum = 0;
7117 unsigned getUncoveredArg() const {
7161 unsigned BitWidth = Offset.getBitWidth();
7162 unsigned AddendBitWidth = Addend.getBitWidth();
7189 assert(BitWidth <= std::numeric_limits<unsigned>::max() / 2 &&
7216 unsigned getByteLength() const {
7220 unsigned getLength() const { return FExpr->getLength() - Offset; }
7221 unsigned getCharByteWidth() const { return FExpr->getCharByteWidth(); }
7235 unsigned ByteNo, const SourceManager &SM, const LangOptions &Features,
7236 const TargetInfo &Target, unsigned *StartToken = nullptr,
7237 unsigned *StartTokenByteOffset = nullptr) const {
7254 bool HasVAListArg, unsigned format_idx,
7255 unsigned firstDataArg,
7269 bool HasVAListArg, unsigned format_idx,
7270 unsigned firstDataArg, Sema::FormatStringType Type,
7451 unsigned BuiltinID = FD->getBuiltinID();
7607 bool HasVAListArg, unsigned format_idx,
7608 unsigned firstDataArg, FormatStringType Type,
7642 unsigned ArgIdx = UncoveredArg.getUncoveredArg() + firstDataArg;
7698 const unsigned FirstDataArg;
7699 const unsigned NumDataArgs;
7703 unsigned FormatIdx;
7715 const Sema::FormatStringType type, unsigned firstDataArg,
7716 unsigned numDataArgs, const char *beg, bool hasVAListArg,
7717 ArrayRef<const Expr *> Args, unsigned formatIdx,
7733 unsigned specifierLen) override;
7738 const char *startSpecifier, unsigned specifierLen,
7739 unsigned DiagID);
7743 const char *startSpecifier, unsigned specifierLen);
7747 const char *startSpecifier, unsigned specifierLen);
7749 void HandlePosition(const char *startPos, unsigned posLen) override;
7752 unsigned specifierLen,
7755 void HandleZeroPosition(const char *startPos, unsigned posLen) override;
7767 bool HandleInvalidConversionSpecifier(unsigned argIndex, SourceLocation Loc,
7769 unsigned specifierLen,
7770 const char *csStart, unsigned csLen);
7774 unsigned specifierLen);
7778 unsigned specifierLen);
7781 const Expr *getDataArg(unsigned i) const;
7785 const char *startSpecifier, unsigned specifierLen,
7786 unsigned argIndex);
7801 getSpecifierRange(const char *startSpecifier, unsigned specifierLen) {
7817 unsigned specifierLen){
7827 const char *startSpecifier, unsigned specifierLen, unsigned DiagID) {
7860 const char *startSpecifier, unsigned specifierLen) {
7890 const char *startSpecifier, unsigned specifierLen) {
7916 unsigned posLen) {
7924 CheckFormatHandler::HandleInvalidPosition(const char *startPos, unsigned posLen,
7927 << (unsigned) p,
7933 unsigned posLen) {
7952 const Expr *CheckFormatHandler::getDataArg(unsigned i) const {
7964 assert((unsigned)notCoveredArg < NumDataArgs);
7996 CheckFormatHandler::HandleInvalidConversionSpecifier(unsigned argIndex,
7999 unsigned specifierLen,
8001 unsigned csLen) {
8032 unsigned char FirstChar = *csStart;
8057 unsigned specifierLen) {
8067 const char *startSpecifier, unsigned specifierLen, unsigned argIndex) {
8153 const Sema::FormatStringType type, unsigned firstDataArg,
8154 unsigned numDataArgs, bool isObjC, const char *beg,
8156 unsigned formatIdx, bool inFunctionCall,
8176 unsigned specifierLen) override;
8182 unsigned specifierLen) override;
8185 unsigned SpecifierLen,
8188 bool HandleAmount(const analyze_format_string::OptionalAmount &Amt, unsigned k,
8189 const char *startSpecifier, unsigned specifierLen);
8192 unsigned type,
8193 const char *startSpecifier, unsigned specifierLen);
8196 const char *startSpecifier, unsigned specifierLen);
8200 const char *startSpecifier, unsigned specifierLen);
8205 unsigned flagLen) override;
8208 unsigned flagLen) override;
8221 unsigned specifierLen) {
8237 unsigned k, const char *startSpecifier,
8238 unsigned specifierLen) {
8241 unsigned argIndex = Amt.getArgIndex();
8255 // an 'unsigned int' as that is a reasonably safe case. GCC also
8286 unsigned type,
8288 unsigned specifierLen) {
8309 unsigned specifierLen) {
8327 unsigned specifierLen) {
8339 unsigned flagLen) {
8348 unsigned flagLen) {
8445 unsigned specifierLen) {
8482 unsigned argIndex = FS.getArgIndex();
8767 unsigned SpecifierLen,
8855 // 'unichar' is defined as a typedef of unsigned short, but we should
8910 unsigned Diag;
8979 unsigned Diag = Match == ArgType::NoMatchPedantic
9006 unsigned Diag;
9070 unsigned firstDataArg, unsigned numDataArgs,
9072 ArrayRef<const Expr *> Args, unsigned formatIdx,
9083 unsigned specifierLen) override;
9088 unsigned specifierLen) override;
9105 unsigned specifierLen) {
9118 unsigned specifierLen) {
9158 unsigned argIndex = FS.getArgIndex();
9208 unsigned Diag =
9241 bool HasVAListArg, unsigned format_idx,
9242 unsigned firstDataArg,
9267 const unsigned numDataArgs = Args.size() - firstDataArg;
9339 static unsigned getLargerAbsoluteValueFunction(unsigned AbsFunction) {
9390 unsigned AbsType) {
9411 static unsigned getBestAbsFunction(ASTContext &Context, QualType ArgType,
9412 unsigned AbsFunctionKind) {
9413 unsigned BestKind = 0;
9415 for (unsigned Kind = AbsFunctionKind; Kind != 0;
9449 static unsigned changeAbsFunction(unsigned AbsKind,
9513 static unsigned getAbsoluteValueFunctionKind(const FunctionDecl *FDecl) {
9547 unsigned AbsKind, QualType ArgType) {
9647 unsigned AbsKind = getAbsoluteValueFunctionKind(FDecl);
9655 // Unsigned types cannot be negative. Suggest removing the absolute value
9670 unsigned DiagType = 0;
9694 unsigned NewAbsKind = getBestAbsFunction(Context, ArgType, AbsKind);
9709 unsigned NewAbsKind = changeAbsFunction(AbsKind, ArgValueKind);
9721 //===--- CHECK: Warn on use of std::max and unsigned zero. r---------------===//
9737 // Check that template type argument is unsigned integer.
10001 static void CheckMemaccessSize(Sema &S, unsigned BId, const CallExpr *Call) {
10055 unsigned BId,
10061 unsigned ExpectedNumArgs =
10066 unsigned LastArg = (BId == Builtin::BImemset || BId == Builtin::BIbzero ||
10068 unsigned LenArg =
10091 for (unsigned ArgIdx = 0; ArgIdx != LastArg; ++ArgIdx) {
10121 unsigned ActionIdx = 0; // Default is to suggest dereferencing.
10190 unsigned OperationType = 0;
10286 unsigned NumArgs = Call->getNumArgs();
10385 unsigned PatternType = 0;
10654 unsigned Width;
10661 IntRange(unsigned Width, bool NonNegative)
10665 unsigned valueBits() const {
10705 unsigned NumPositive = Enum->getNumPositiveBits();
10706 unsigned NumNegative = Enum->getNumNegativeBits();
10752 bool Unsigned = L.NonNegative && R.NonNegative;
10753 return IntRange(std::max(L.valueBits(), R.valueBits()) + !Unsigned,
10759 unsigned Bits = std::max(L.Width, R.Width);
10774 bool Unsigned = L.NonNegative && R.NonNegative;
10775 return IntRange(std::max(L.valueBits(), R.valueBits()) + 1 + !Unsigned,
10776 Unsigned);
10785 bool Unsigned = L.NonNegative && R.Width == 0;
10787 !Unsigned,
10788 Unsigned);
10797 bool Unsigned = L.NonNegative && R.NonNegative;
10798 return IntRange(L.valueBits() + R.valueBits() + CanWiden + !Unsigned,
10799 Unsigned);
10806 bool Unsigned = L.NonNegative;
10807 return IntRange(std::min(L.valueBits(), R.valueBits()) + !Unsigned,
10808 Unsigned);
10815 unsigned MaxWidth) {
10828 unsigned MaxWidth) {
10834 for (unsigned i = 1, e = result.getVectorLength(); i != e; ++i) {
10871 static IntRange GetExprRange(ASTContext &C, const Expr *E, unsigned MaxWidth,
11008 unsigned zext = shift->getZExtValue();
11045 unsigned opWidth = C.getIntWidth(GetExprType(E));
11052 unsigned log2 = divisor->logBase2(); // floor(log_2(divisor))
11081 unsigned opWidth = C.getIntWidth(T);
11153 for (unsigned i = 0, e = value.getVectorLength(); i != e; ++i)
11202 /// ... where there is only a hole if a signed type is promoted to unsigned
11211 PromotedRange(IntRange R, unsigned BitWidth, bool Unsigned) {
11213 PromotedMin = PromotedMax = llvm::APSInt(BitWidth, Unsigned);
11214 else if (R.Width >= BitWidth && !Unsigned) {
11216 // a < 32-bit unsigned / <= 32-bit signed bit-field to 'signed int'.
11218 PromotedMin = llvm::APSInt::getMinValue(BitWidth, Unsigned);
11219 PromotedMax = llvm::APSInt::getMaxValue(BitWidth, Unsigned);
11223 PromotedMin.setIsUnsigned(Unsigned);
11227 PromotedMax.setIsUnsigned(Unsigned);
11428 // A comparison of an unsigned bit-field against 0 is really a type problem,
11481 unsigned Diag =
11547 // We don't do anything special if this isn't an unsigned integral
11571 "unsigned comparison between two signed integer expressions?");
11594 // For (in)equality comparisons, if the unsigned operand is a
11596 // then reinterpreting the signed operand as unsigned will not
11599 unsigned comparisonWidth = S.Context.getIntWidth(T);
11604 // We should never be unable to prove that the unsigned operand is
11606 assert(unsignedRange.NonNegative && "unsigned range includes negative?");
11634 // If the underlying enum type was not explicitly specified as an unsigned
11657 unsigned FieldWidth = Bitfield->getBitWidthValue(S.Context);
11676 // have exactly the right number of bits to store this unsigned enum,
11677 // suggest changing the enum to an unsigned type. This typically happens
11679 unsigned DiagID = 0;
11699 unsigned BitsNeeded = SignedEnum ? std::max(ED->getNumPositiveBits() + 1,
11718 unsigned OriginalWidth = Value.getBitWidth();
11778 SourceLocation CContext, unsigned diag,
11794 unsigned diag, bool pruneControlFlow = false) {
11861 unsigned precision = llvm::APFloat::semanticsPrecision(Value.getSemantics());
11887 unsigned DiagID = 0;
12003 unsigned NumArgs = TheCall->getNumArgs();
12004 for (unsigned i = 0; i < NumArgs; ++i) {
12081 unsigned ElementKind) {
12128 for (unsigned I = 0, N = ArrayLiteral->getNumElements(); I != N; ++I) {
12158 for (unsigned I = 0, N = DictionaryLiteral->getNumElements(); I != N; ++I) {
12210 // Do not diagnose unsigned shifts.
12411 if (unsigned NumArgs = CEx->getNumArgs()) {
12496 unsigned int SourcePrecision = SourceRange.Width;
12500 unsigned int TargetPrecision = llvm::APFloatBase::semanticsPrecision(
12645 unsigned DiagID = diag::warn_impcast_integer_sign;
12985 unsigned DiagID = IsCompare ? diag::warn_this_null_compare
13001 unsigned DiagID = IsCompare
13016 unsigned DiagID = IsCompare ? diag::warn_nonnull_expr_compare
13060 unsigned ParamNo = std::distance(FD->param_begin(), ParamIter);
13097 unsigned DiagID = IsCompare ? diag::warn_null_pointer_compare
13223 explicit Value(unsigned Parent) : Parent(Parent), Merged(false) {}
13224 unsigned Parent : 31;
13225 unsigned Merged : 1;
13235 unsigned Index;
13237 explicit Seq(unsigned N) : Index(N) {}
13263 unsigned C = representative(Cur.Index);
13264 unsigned Target = representative(Old.Index);
13275 unsigned representative(unsigned K) {
14032 for (unsigned I = 0; I < Elts.size(); ++I)
14043 for (unsigned I = 0; I < ILE->getNumInits(); ++I) {
14054 for (unsigned I = 0; I < Elts.size(); ++I)
14465 << static_cast<unsigned>(SrcAlign.getQuantity())
14466 << static_cast<unsigned>(DestAlign.getQuantity())
14617 unsigned DiagID = diag::warn_ptr_arith_exceeds_bounds;
14624 << (unsigned)size.getLimitedValue(~0U)
14627 unsigned DiagID = diag::warn_array_index_precedes_bounds;
15139 for (unsigned i = 0, e = msg->getNumArgs(); i != e; ++i) {
15187 << (unsigned) Kind
15266 unsigned Attributes = PD->getPropertyAttributes();
15271 unsigned AsWrittenAttr = PD->getPropertyAttributesAsWritten();
15306 unsigned StmtLine = SourceMgr.getPresumedLineNumber(StmtLoc,
15312 unsigned BodyLine = SourceMgr.getSpellingLineNumber(Body->getSemiLoc(),
15326 unsigned DiagID) {
15351 unsigned DiagID;
15390 unsigned BodyCol = SourceMgr.getPresumedColumnNumber(
15396 unsigned StmtCol =
15522 unsigned Bits1 = Field1->getBitWidthValue(C);
15523 unsigned Bits2 = Field2->getBitWidthValue(C);
15827 unsigned TypeTagIdxAST = Attr->getTypeTagIdx().getASTIndex();
15847 unsigned ArgumentIdxAST = Attr->getArgumentIdx().getASTIndex();
15889 // Plain char, signed char, and unsigned char are three distinct types.
15891 // But we treat plain `char' as equivalent to `signed char' or `unsigned
16100 static llvm::Optional<unsigned>
16129 unsigned PtrArgIdx = 0;
16199 llvm::Optional<unsigned> MaybeRows;
16203 llvm::Optional<unsigned> MaybeColumns;
16239 unsigned PtrArgIdx = 1;