Lines Matching refs:TheCall
72 static bool SemaBuiltinAnnotation(Sema &S, CallExpr *TheCall) { in SemaBuiltinAnnotation() argument
73 if (checkArgCount(S, TheCall, 2)) in SemaBuiltinAnnotation()
77 Expr *ValArg = TheCall->getArg(0); in SemaBuiltinAnnotation()
86 Expr *StrArg = TheCall->getArg(1)->IgnoreParenCasts(); in SemaBuiltinAnnotation()
94 TheCall->setType(Ty); in SemaBuiltinAnnotation()
100 static bool SemaBuiltinAddressof(Sema &S, CallExpr *TheCall) { in SemaBuiltinAddressof() argument
101 if (checkArgCount(S, TheCall, 1)) in SemaBuiltinAddressof()
104 ExprResult Arg(TheCall->getArg(0)); in SemaBuiltinAddressof()
105 QualType ResultType = S.CheckAddressOfOperand(Arg, TheCall->getLocStart()); in SemaBuiltinAddressof()
109 TheCall->setArg(0, Arg.get()); in SemaBuiltinAddressof()
110 TheCall->setType(ResultType); in SemaBuiltinAddressof()
115 CallExpr *TheCall, unsigned SizeIdx, in SemaBuiltinMemChkCall() argument
117 if (TheCall->getNumArgs() <= SizeIdx || in SemaBuiltinMemChkCall()
118 TheCall->getNumArgs() <= DstSizeIdx) in SemaBuiltinMemChkCall()
121 const Expr *SizeArg = TheCall->getArg(SizeIdx); in SemaBuiltinMemChkCall()
122 const Expr *DstSizeArg = TheCall->getArg(DstSizeIdx); in SemaBuiltinMemChkCall()
136 SourceLocation SL = TheCall->getLocStart(); in SemaBuiltinMemChkCall()
137 SourceRange SR = TheCall->getSourceRange(); in SemaBuiltinMemChkCall()
205 static bool SemaBuiltinSEHScopeCheck(Sema &SemaRef, CallExpr *TheCall, in SemaBuiltinSEHScopeCheck() argument
218 auto *DRE = cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts()); in SemaBuiltinSEHScopeCheck()
219 SemaRef.Diag(TheCall->getExprLoc(), DiagID) in SemaBuiltinSEHScopeCheck()
229 CallExpr *TheCall) { in CheckBuiltinFunctionCall() argument
230 ExprResult TheCallResult(TheCall); in CheckBuiltinFunctionCall()
245 if (SemaBuiltinConstantArg(TheCall, ArgNo, Result)) in CheckBuiltinFunctionCall()
252 assert(TheCall->getNumArgs() == 1 && in CheckBuiltinFunctionCall()
254 if (CheckObjCString(TheCall->getArg(0))) in CheckBuiltinFunctionCall()
259 if (SemaBuiltinVAStart(TheCall)) in CheckBuiltinFunctionCall()
266 if (SemaBuiltinVAStartARM(TheCall)) in CheckBuiltinFunctionCall()
270 if (SemaBuiltinVAStart(TheCall)) in CheckBuiltinFunctionCall()
282 if (SemaBuiltinUnorderedCompare(TheCall)) in CheckBuiltinFunctionCall()
286 if (SemaBuiltinFPClassification(TheCall, 6)) in CheckBuiltinFunctionCall()
294 if (SemaBuiltinFPClassification(TheCall, 1)) in CheckBuiltinFunctionCall()
298 return SemaBuiltinShuffleVector(TheCall); in CheckBuiltinFunctionCall()
302 if (SemaBuiltinPrefetch(TheCall)) in CheckBuiltinFunctionCall()
307 if (SemaBuiltinAssume(TheCall)) in CheckBuiltinFunctionCall()
311 if (SemaBuiltinAssumeAligned(TheCall)) in CheckBuiltinFunctionCall()
315 if (SemaBuiltinConstantArgRange(TheCall, 1, 0, 3)) in CheckBuiltinFunctionCall()
319 if (SemaBuiltinLongjmp(TheCall)) in CheckBuiltinFunctionCall()
323 if (SemaBuiltinSetjmp(TheCall)) in CheckBuiltinFunctionCall()
328 if (checkArgCount(*this, TheCall, 1)) in CheckBuiltinFunctionCall()
333 if (checkArgCount(*this, TheCall, 1)) return true; in CheckBuiltinFunctionCall()
334 TheCall->setType(Context.IntTy); in CheckBuiltinFunctionCall()
337 if (checkArgCount(*this, TheCall, 1)) return true; in CheckBuiltinFunctionCall()
338 TheCall->setType(Context.IntTy); in CheckBuiltinFunctionCall()
449 if (SemaBuiltinAnnotation(*this, TheCall)) in CheckBuiltinFunctionCall()
453 if (SemaBuiltinAddressof(*this, TheCall)) in CheckBuiltinFunctionCall()
459 Diag(TheCall->getExprLoc(), diag::err_builtin_requires_language) in CheckBuiltinFunctionCall()
481 SemaBuiltinMemChkCall(*this, FDecl, TheCall, 2, 3); in CheckBuiltinFunctionCall()
484 SemaBuiltinMemChkCall(*this, FDecl, TheCall, 3, 4); in CheckBuiltinFunctionCall()
488 SemaBuiltinMemChkCall(*this, FDecl, TheCall, 1, 3); in CheckBuiltinFunctionCall()
492 if (SemaBuiltinCallWithStaticChain(*this, TheCall)) in CheckBuiltinFunctionCall()
498 if (SemaBuiltinSEHScopeCheck(*this, TheCall, Scope::SEHExceptScope, in CheckBuiltinFunctionCall()
505 if (SemaBuiltinSEHScopeCheck(*this, TheCall, Scope::SEHFilterScope, in CheckBuiltinFunctionCall()
512 if (checkArgCount(*this, TheCall, 1)) in CheckBuiltinFunctionCall()
516 TheCall->getLocStart(), in CheckBuiltinFunctionCall()
518 TheCall)) in CheckBuiltinFunctionCall()
521 TheCall->setType(Context.VoidPtrTy); in CheckBuiltinFunctionCall()
534 if (CheckARMBuiltinFunctionCall(BuiltinID, TheCall)) in CheckBuiltinFunctionCall()
539 if (CheckAArch64BuiltinFunctionCall(BuiltinID, TheCall)) in CheckBuiltinFunctionCall()
546 if (CheckMipsBuiltinFunctionCall(BuiltinID, TheCall)) in CheckBuiltinFunctionCall()
550 if (CheckSystemZBuiltinFunctionCall(BuiltinID, TheCall)) in CheckBuiltinFunctionCall()
555 if (CheckX86BuiltinFunctionCall(BuiltinID, TheCall)) in CheckBuiltinFunctionCall()
561 if (CheckPPCBuiltinFunctionCall(BuiltinID, TheCall)) in CheckBuiltinFunctionCall()
639 bool Sema::CheckNeonBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { in CheckNeonBuiltinFunctionCall() argument
653 unsigned ImmArg = TheCall->getNumArgs()-1; in CheckNeonBuiltinFunctionCall()
655 if (SemaBuiltinConstantArg(TheCall, ImmArg, Result)) in CheckNeonBuiltinFunctionCall()
660 return Diag(TheCall->getLocStart(), diag::err_invalid_neon_type_code) in CheckNeonBuiltinFunctionCall()
661 << TheCall->getArg(ImmArg)->getSourceRange(); in CheckNeonBuiltinFunctionCall()
666 Expr *Arg = TheCall->getArg(PtrArgNum); in CheckNeonBuiltinFunctionCall()
701 return SemaBuiltinConstantArgRange(TheCall, i, l, u + l); in CheckNeonBuiltinFunctionCall()
704 bool Sema::CheckARMBuiltinExclusiveCall(unsigned BuiltinID, CallExpr *TheCall, in CheckARMBuiltinExclusiveCall() argument
720 DeclRefExpr *DRE =cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts()); in CheckARMBuiltinExclusiveCall()
723 if (checkArgCount(*this, TheCall, IsLdrex ? 1 : 2)) in CheckARMBuiltinExclusiveCall()
730 Expr *PointerArg = TheCall->getArg(IsLdrex ? 0 : 1); in CheckARMBuiltinExclusiveCall()
768 TheCall->setArg(IsLdrex ? 0 : 1, PointerArg); in CheckARMBuiltinExclusiveCall()
802 TheCall->setType(ValType); in CheckARMBuiltinExclusiveCall()
807 ExprResult ValArg = TheCall->getArg(0); in CheckARMBuiltinExclusiveCall()
813 TheCall->setArg(0, ValArg.get()); in CheckARMBuiltinExclusiveCall()
817 TheCall->setType(Context.IntTy); in CheckARMBuiltinExclusiveCall()
821 bool Sema::CheckARMBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { in CheckARMBuiltinFunctionCall() argument
828 return CheckARMBuiltinExclusiveCall(BuiltinID, TheCall, 64); in CheckARMBuiltinFunctionCall()
832 return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) || in CheckARMBuiltinFunctionCall()
833 SemaBuiltinConstantArgRange(TheCall, 2, 0, 1); in CheckARMBuiltinFunctionCall()
836 if (CheckNeonBuiltinFunctionCall(BuiltinID, TheCall)) in CheckARMBuiltinFunctionCall()
855 return SemaBuiltinConstantArgRange(TheCall, i, l, u + l); in CheckARMBuiltinFunctionCall()
859 CallExpr *TheCall) { in CheckAArch64BuiltinFunctionCall() argument
866 return CheckARMBuiltinExclusiveCall(BuiltinID, TheCall, 128); in CheckAArch64BuiltinFunctionCall()
870 return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) || in CheckAArch64BuiltinFunctionCall()
871 SemaBuiltinConstantArgRange(TheCall, 2, 0, 2) || in CheckAArch64BuiltinFunctionCall()
872 SemaBuiltinConstantArgRange(TheCall, 3, 0, 1) || in CheckAArch64BuiltinFunctionCall()
873 SemaBuiltinConstantArgRange(TheCall, 4, 0, 1); in CheckAArch64BuiltinFunctionCall()
876 if (CheckNeonBuiltinFunctionCall(BuiltinID, TheCall)) in CheckAArch64BuiltinFunctionCall()
889 return SemaBuiltinConstantArgRange(TheCall, i, l, u + l); in CheckAArch64BuiltinFunctionCall()
892 bool Sema::CheckMipsBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { in CheckMipsBuiltinFunctionCall() argument
905 return SemaBuiltinConstantArgRange(TheCall, i, l, u); in CheckMipsBuiltinFunctionCall()
908 bool Sema::CheckPPCBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { in CheckPPCBuiltinFunctionCall() argument
923 return Diag(TheCall->getLocStart(), diag::err_64_bit_builtin_32_bit_tgt) in CheckPPCBuiltinFunctionCall()
924 << TheCall->getSourceRange(); in CheckPPCBuiltinFunctionCall()
929 return Diag(TheCall->getLocStart(), diag::err_ppc_builtin_only_on_pwr7) in CheckPPCBuiltinFunctionCall()
930 << TheCall->getSourceRange(); in CheckPPCBuiltinFunctionCall()
936 return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) || in CheckPPCBuiltinFunctionCall()
937 SemaBuiltinConstantArgRange(TheCall, 2, 0, 15); in CheckPPCBuiltinFunctionCall()
945 return SemaBuiltinConstantArgRange(TheCall, 0, 0, 31) || in CheckPPCBuiltinFunctionCall()
946 SemaBuiltinConstantArgRange(TheCall, 2, 0, 31); in CheckPPCBuiltinFunctionCall()
948 return SemaBuiltinConstantArgRange(TheCall, i, l, u); in CheckPPCBuiltinFunctionCall()
952 CallExpr *TheCall) { in CheckSystemZBuiltinFunctionCall() argument
954 Expr *Arg = TheCall->getArg(0); in CheckSystemZBuiltinFunctionCall()
965 bool Sema::CheckX86BuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { in CheckX86BuiltinFunctionCall() argument
1022 return SemaBuiltinConstantArgRange(TheCall, i, l, u); in CheckX86BuiltinFunctionCall()
1231 bool Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall, in CheckFunctionCall() argument
1233 bool IsMemberOperatorCall = isa<CXXOperatorCallExpr>(TheCall) && in CheckFunctionCall()
1235 bool IsMemberFunction = isa<CXXMemberCallExpr>(TheCall) || in CheckFunctionCall()
1238 TheCall->getCallee()); in CheckFunctionCall()
1240 Expr** Args = TheCall->getArgs(); in CheckFunctionCall()
1241 unsigned NumArgs = TheCall->getNumArgs(); in CheckFunctionCall()
1250 IsMemberFunction, TheCall->getRParenLoc(), in CheckFunctionCall()
1251 TheCall->getCallee()->getSourceRange(), CallType); in CheckFunctionCall()
1259 CheckAbsoluteValueFunction(TheCall, FDecl, FnInfo); in CheckFunctionCall()
1269 CheckStrlcpycatArguments(TheCall, FnInfo); in CheckFunctionCall()
1271 CheckStrncatArguments(TheCall, FnInfo); in CheckFunctionCall()
1273 CheckMemaccessArguments(TheCall, CMId, FnInfo); in CheckFunctionCall()
1290 bool Sema::CheckPointerCall(NamedDecl *NDecl, CallExpr *TheCall, in CheckPointerCall() argument
1310 checkCall(NDecl, llvm::makeArrayRef(TheCall->getArgs(), in CheckPointerCall()
1311 TheCall->getNumArgs()), in CheckPointerCall()
1312 NumParams, /*IsMemberFunction=*/false, TheCall->getRParenLoc(), in CheckPointerCall()
1313 TheCall->getCallee()->getSourceRange(), CallType); in CheckPointerCall()
1320 bool Sema::CheckOtherCall(CallExpr *TheCall, const FunctionProtoType *Proto) { in CheckOtherCall() argument
1322 TheCall->getCallee()); in CheckOtherCall()
1326 llvm::makeArrayRef(TheCall->getArgs(), TheCall->getNumArgs()), in CheckOtherCall()
1327 NumParams, /*IsMemberFunction=*/false, TheCall->getRParenLoc(), in CheckOtherCall()
1328 TheCall->getCallee()->getSourceRange(), CallType); in CheckOtherCall()
1362 CallExpr *TheCall = cast<CallExpr>(TheCallResult.get()); in SemaAtomicOpsOverloaded() local
1363 DeclRefExpr *DRE =cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts()); in SemaAtomicOpsOverloaded()
1465 if (TheCall->getNumArgs() < NumArgs[Form]) { in SemaAtomicOpsOverloaded()
1466 Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args) in SemaAtomicOpsOverloaded()
1467 << 0 << NumArgs[Form] << TheCall->getNumArgs() in SemaAtomicOpsOverloaded()
1468 << TheCall->getCallee()->getSourceRange(); in SemaAtomicOpsOverloaded()
1470 } else if (TheCall->getNumArgs() > NumArgs[Form]) { in SemaAtomicOpsOverloaded()
1471 Diag(TheCall->getArg(NumArgs[Form])->getLocStart(), in SemaAtomicOpsOverloaded()
1473 << 0 << NumArgs[Form] << TheCall->getNumArgs() in SemaAtomicOpsOverloaded()
1474 << TheCall->getCallee()->getSourceRange(); in SemaAtomicOpsOverloaded()
1479 Expr *Ptr = TheCall->getArg(0); in SemaAtomicOpsOverloaded()
1610 ExprResult Arg = TheCall->getArg(i); in SemaAtomicOpsOverloaded()
1614 TheCall->setArg(i, Arg.get()); in SemaAtomicOpsOverloaded()
1623 SubExprs.push_back(TheCall->getArg(1)); // Val1 in SemaAtomicOpsOverloaded()
1626 SubExprs.push_back(TheCall->getArg(1)); // Order in SemaAtomicOpsOverloaded()
1631 SubExprs.push_back(TheCall->getArg(2)); // Order in SemaAtomicOpsOverloaded()
1632 SubExprs.push_back(TheCall->getArg(1)); // Val1 in SemaAtomicOpsOverloaded()
1636 SubExprs.push_back(TheCall->getArg(3)); // Order in SemaAtomicOpsOverloaded()
1637 SubExprs.push_back(TheCall->getArg(1)); // Val1 in SemaAtomicOpsOverloaded()
1638 SubExprs.push_back(TheCall->getArg(2)); // Val2 in SemaAtomicOpsOverloaded()
1641 SubExprs.push_back(TheCall->getArg(3)); // Order in SemaAtomicOpsOverloaded()
1642 SubExprs.push_back(TheCall->getArg(1)); // Val1 in SemaAtomicOpsOverloaded()
1643 SubExprs.push_back(TheCall->getArg(4)); // OrderFail in SemaAtomicOpsOverloaded()
1644 SubExprs.push_back(TheCall->getArg(2)); // Val2 in SemaAtomicOpsOverloaded()
1647 SubExprs.push_back(TheCall->getArg(4)); // Order in SemaAtomicOpsOverloaded()
1648 SubExprs.push_back(TheCall->getArg(1)); // Val1 in SemaAtomicOpsOverloaded()
1649 SubExprs.push_back(TheCall->getArg(5)); // OrderFail in SemaAtomicOpsOverloaded()
1650 SubExprs.push_back(TheCall->getArg(2)); // Val2 in SemaAtomicOpsOverloaded()
1651 SubExprs.push_back(TheCall->getArg(3)); // Weak in SemaAtomicOpsOverloaded()
1664 AtomicExpr *AE = new (Context) AtomicExpr(TheCall->getCallee()->getLocStart(), in SemaAtomicOpsOverloaded()
1666 TheCall->getRParenLoc()); in SemaAtomicOpsOverloaded()
1712 CallExpr *TheCall = (CallExpr *)TheCallResult.get(); in SemaBuiltinAtomicOverloaded() local
1713 DeclRefExpr *DRE =cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts()); in SemaBuiltinAtomicOverloaded()
1717 if (TheCall->getNumArgs() < 1) { in SemaBuiltinAtomicOverloaded()
1718 Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least) in SemaBuiltinAtomicOverloaded()
1719 << 0 << 1 << TheCall->getNumArgs() in SemaBuiltinAtomicOverloaded()
1720 << TheCall->getCallee()->getSourceRange(); in SemaBuiltinAtomicOverloaded()
1729 Expr *FirstArg = TheCall->getArg(0); in SemaBuiltinAtomicOverloaded()
1734 TheCall->setArg(0, FirstArg); in SemaBuiltinAtomicOverloaded()
1988 if (TheCall->getNumArgs() < 1+NumFixed) { in SemaBuiltinAtomicOverloaded()
1989 Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least) in SemaBuiltinAtomicOverloaded()
1990 << 0 << 1+NumFixed << TheCall->getNumArgs() in SemaBuiltinAtomicOverloaded()
1991 << TheCall->getCallee()->getSourceRange(); in SemaBuiltinAtomicOverloaded()
1996 Diag(TheCall->getLocEnd(), diag::warn_sync_fetch_and_nand_semantics_change) in SemaBuiltinAtomicOverloaded()
1997 << TheCall->getCallee()->getSourceRange(); in SemaBuiltinAtomicOverloaded()
2022 ExprResult Arg = TheCall->getArg(i+1); in SemaBuiltinAtomicOverloaded()
2039 TheCall->setArg(i+1, Arg.get()); in SemaBuiltinAtomicOverloaded()
2060 TheCall->setCallee(PromotedCall.get()); in SemaBuiltinAtomicOverloaded()
2065 TheCall->setType(ResultType); in SemaBuiltinAtomicOverloaded()
2104 bool Sema::SemaBuiltinVAStart(CallExpr *TheCall) { in SemaBuiltinVAStart() argument
2105 Expr *Fn = TheCall->getCallee(); in SemaBuiltinVAStart()
2106 if (TheCall->getNumArgs() > 2) { in SemaBuiltinVAStart()
2107 Diag(TheCall->getArg(2)->getLocStart(), in SemaBuiltinVAStart()
2109 << 0 /*function call*/ << 2 << TheCall->getNumArgs() in SemaBuiltinVAStart()
2111 << SourceRange(TheCall->getArg(2)->getLocStart(), in SemaBuiltinVAStart()
2112 (*(TheCall->arg_end()-1))->getLocEnd()); in SemaBuiltinVAStart()
2116 if (TheCall->getNumArgs() < 2) { in SemaBuiltinVAStart()
2117 return Diag(TheCall->getLocEnd(), in SemaBuiltinVAStart()
2119 << 0 /*function call*/ << 2 << TheCall->getNumArgs(); in SemaBuiltinVAStart()
2123 if (checkBuiltinArgument(*this, TheCall, 0)) in SemaBuiltinVAStart()
2144 const Expr *Arg = TheCall->getArg(1)->IgnoreParenCasts(); in SemaBuiltinVAStart()
2170 Diag(TheCall->getArg(1)->getLocStart(), in SemaBuiltinVAStart()
2178 TheCall->setType(Context.VoidTy); in SemaBuiltinVAStart()
2236 bool Sema::SemaBuiltinUnorderedCompare(CallExpr *TheCall) { in SemaBuiltinUnorderedCompare() argument
2237 if (TheCall->getNumArgs() < 2) in SemaBuiltinUnorderedCompare()
2238 return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args) in SemaBuiltinUnorderedCompare()
2239 << 0 << 2 << TheCall->getNumArgs()/*function call*/; in SemaBuiltinUnorderedCompare()
2240 if (TheCall->getNumArgs() > 2) in SemaBuiltinUnorderedCompare()
2241 return Diag(TheCall->getArg(2)->getLocStart(), in SemaBuiltinUnorderedCompare()
2243 << 0 /*function call*/ << 2 << TheCall->getNumArgs() in SemaBuiltinUnorderedCompare()
2244 << SourceRange(TheCall->getArg(2)->getLocStart(), in SemaBuiltinUnorderedCompare()
2245 (*(TheCall->arg_end()-1))->getLocEnd()); in SemaBuiltinUnorderedCompare()
2247 ExprResult OrigArg0 = TheCall->getArg(0); in SemaBuiltinUnorderedCompare()
2248 ExprResult OrigArg1 = TheCall->getArg(1); in SemaBuiltinUnorderedCompare()
2259 TheCall->setArg(0, OrigArg0.get()); in SemaBuiltinUnorderedCompare()
2260 TheCall->setArg(1, OrigArg1.get()); in SemaBuiltinUnorderedCompare()
2280 bool Sema::SemaBuiltinFPClassification(CallExpr *TheCall, unsigned NumArgs) { in SemaBuiltinFPClassification() argument
2281 if (TheCall->getNumArgs() < NumArgs) in SemaBuiltinFPClassification()
2282 return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args) in SemaBuiltinFPClassification()
2283 << 0 << NumArgs << TheCall->getNumArgs()/*function call*/; in SemaBuiltinFPClassification()
2284 if (TheCall->getNumArgs() > NumArgs) in SemaBuiltinFPClassification()
2285 return Diag(TheCall->getArg(NumArgs)->getLocStart(), in SemaBuiltinFPClassification()
2287 << 0 /*function call*/ << NumArgs << TheCall->getNumArgs() in SemaBuiltinFPClassification()
2288 << SourceRange(TheCall->getArg(NumArgs)->getLocStart(), in SemaBuiltinFPClassification()
2289 (*(TheCall->arg_end()-1))->getLocEnd()); in SemaBuiltinFPClassification()
2291 Expr *OrigArg = TheCall->getArg(NumArgs-1); in SemaBuiltinFPClassification()
2309 TheCall->setArg(NumArgs-1, CastArg); in SemaBuiltinFPClassification()
2318 ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) { in SemaBuiltinShuffleVector() argument
2319 if (TheCall->getNumArgs() < 2) in SemaBuiltinShuffleVector()
2320 return ExprError(Diag(TheCall->getLocEnd(), in SemaBuiltinShuffleVector()
2322 << 0 /*function call*/ << 2 << TheCall->getNumArgs() in SemaBuiltinShuffleVector()
2323 << TheCall->getSourceRange()); in SemaBuiltinShuffleVector()
2329 QualType resType = TheCall->getArg(0)->getType(); in SemaBuiltinShuffleVector()
2332 if (!TheCall->getArg(0)->isTypeDependent() && in SemaBuiltinShuffleVector()
2333 !TheCall->getArg(1)->isTypeDependent()) { in SemaBuiltinShuffleVector()
2334 QualType LHSType = TheCall->getArg(0)->getType(); in SemaBuiltinShuffleVector()
2335 QualType RHSType = TheCall->getArg(1)->getType(); in SemaBuiltinShuffleVector()
2338 return ExprError(Diag(TheCall->getLocStart(), in SemaBuiltinShuffleVector()
2340 << SourceRange(TheCall->getArg(0)->getLocStart(), in SemaBuiltinShuffleVector()
2341 TheCall->getArg(1)->getLocEnd())); in SemaBuiltinShuffleVector()
2344 unsigned numResElements = TheCall->getNumArgs() - 2; in SemaBuiltinShuffleVector()
2349 if (TheCall->getNumArgs() == 2) { in SemaBuiltinShuffleVector()
2352 return ExprError(Diag(TheCall->getLocStart(), in SemaBuiltinShuffleVector()
2354 << SourceRange(TheCall->getArg(1)->getLocStart(), in SemaBuiltinShuffleVector()
2355 TheCall->getArg(1)->getLocEnd())); in SemaBuiltinShuffleVector()
2357 return ExprError(Diag(TheCall->getLocStart(), in SemaBuiltinShuffleVector()
2359 << SourceRange(TheCall->getArg(0)->getLocStart(), in SemaBuiltinShuffleVector()
2360 TheCall->getArg(1)->getLocEnd())); in SemaBuiltinShuffleVector()
2368 for (unsigned i = 2; i < TheCall->getNumArgs(); i++) { in SemaBuiltinShuffleVector()
2369 if (TheCall->getArg(i)->isTypeDependent() || in SemaBuiltinShuffleVector()
2370 TheCall->getArg(i)->isValueDependent()) in SemaBuiltinShuffleVector()
2374 if (!TheCall->getArg(i)->isIntegerConstantExpr(Result, Context)) in SemaBuiltinShuffleVector()
2375 return ExprError(Diag(TheCall->getLocStart(), in SemaBuiltinShuffleVector()
2377 << TheCall->getArg(i)->getSourceRange()); in SemaBuiltinShuffleVector()
2384 return ExprError(Diag(TheCall->getLocStart(), in SemaBuiltinShuffleVector()
2386 << TheCall->getArg(i)->getSourceRange()); in SemaBuiltinShuffleVector()
2391 for (unsigned i = 0, e = TheCall->getNumArgs(); i != e; i++) { in SemaBuiltinShuffleVector()
2392 exprs.push_back(TheCall->getArg(i)); in SemaBuiltinShuffleVector()
2393 TheCall->setArg(i, nullptr); in SemaBuiltinShuffleVector()
2397 TheCall->getCallee()->getLocStart(), in SemaBuiltinShuffleVector()
2398 TheCall->getRParenLoc()); in SemaBuiltinShuffleVector()
2434 bool Sema::SemaBuiltinPrefetch(CallExpr *TheCall) { in SemaBuiltinPrefetch() argument
2435 unsigned NumArgs = TheCall->getNumArgs(); in SemaBuiltinPrefetch()
2438 return Diag(TheCall->getLocEnd(), in SemaBuiltinPrefetch()
2441 << TheCall->getSourceRange(); in SemaBuiltinPrefetch()
2446 if (SemaBuiltinConstantArgRange(TheCall, i, 0, i == 1 ? 1 : 3)) in SemaBuiltinPrefetch()
2455 bool Sema::SemaBuiltinAssume(CallExpr *TheCall) { in SemaBuiltinAssume() argument
2456 Expr *Arg = TheCall->getArg(0); in SemaBuiltinAssume()
2462 << cast<FunctionDecl>(TheCall->getCalleeDecl())->getIdentifier(); in SemaBuiltinAssume()
2469 bool Sema::SemaBuiltinAssumeAligned(CallExpr *TheCall) { in SemaBuiltinAssumeAligned() argument
2470 unsigned NumArgs = TheCall->getNumArgs(); in SemaBuiltinAssumeAligned()
2473 return Diag(TheCall->getLocEnd(), in SemaBuiltinAssumeAligned()
2476 << TheCall->getSourceRange(); in SemaBuiltinAssumeAligned()
2479 Expr *Arg = TheCall->getArg(1); in SemaBuiltinAssumeAligned()
2484 if (SemaBuiltinConstantArg(TheCall, 1, Result)) in SemaBuiltinAssumeAligned()
2488 return Diag(TheCall->getLocStart(), in SemaBuiltinAssumeAligned()
2494 ExprResult Arg(TheCall->getArg(2)); in SemaBuiltinAssumeAligned()
2499 TheCall->setArg(2, Arg.get()); in SemaBuiltinAssumeAligned()
2507 bool Sema::SemaBuiltinConstantArg(CallExpr *TheCall, int ArgNum, in SemaBuiltinConstantArg() argument
2509 Expr *Arg = TheCall->getArg(ArgNum); in SemaBuiltinConstantArg()
2510 DeclRefExpr *DRE =cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts()); in SemaBuiltinConstantArg()
2516 return Diag(TheCall->getLocStart(), diag::err_constant_integer_arg_type) in SemaBuiltinConstantArg()
2524 bool Sema::SemaBuiltinConstantArgRange(CallExpr *TheCall, int ArgNum, in SemaBuiltinConstantArgRange() argument
2529 Expr *Arg = TheCall->getArg(ArgNum); in SemaBuiltinConstantArgRange()
2534 if (SemaBuiltinConstantArg(TheCall, ArgNum, Result)) in SemaBuiltinConstantArgRange()
2538 return Diag(TheCall->getLocStart(), diag::err_argument_invalid_range) in SemaBuiltinConstantArgRange()
2547 bool Sema::SemaBuiltinLongjmp(CallExpr *TheCall) { in SemaBuiltinLongjmp() argument
2549 return Diag(TheCall->getLocStart(), diag::err_builtin_longjmp_unsupported) in SemaBuiltinLongjmp()
2550 << SourceRange(TheCall->getLocStart(), TheCall->getLocEnd()); in SemaBuiltinLongjmp()
2552 Expr *Arg = TheCall->getArg(1); in SemaBuiltinLongjmp()
2556 if (SemaBuiltinConstantArg(TheCall, 1, Result)) in SemaBuiltinLongjmp()
2560 return Diag(TheCall->getLocStart(), diag::err_builtin_longjmp_invalid_val) in SemaBuiltinLongjmp()
2569 bool Sema::SemaBuiltinSetjmp(CallExpr *TheCall) { in SemaBuiltinSetjmp() argument
2571 return Diag(TheCall->getLocStart(), diag::err_builtin_setjmp_unsupported) in SemaBuiltinSetjmp()
2572 << SourceRange(TheCall->getLocStart(), TheCall->getLocEnd()); in SemaBuiltinSetjmp()
6522 void CheckImplicitArgumentConversions(Sema &S, CallExpr *TheCall, in CheckImplicitArgumentConversions() argument
6524 unsigned NumArgs = TheCall->getNumArgs(); in CheckImplicitArgumentConversions()
6526 Expr *CurrA = TheCall->getArg(i); in CheckImplicitArgumentConversions()
6531 IsImplicitBoolFloatConversion(S, TheCall->getArg(i - 1), false)); in CheckImplicitArgumentConversions()
6533 IsImplicitBoolFloatConversion(S, TheCall->getArg(i + 1), false)); in CheckImplicitArgumentConversions()