Lines Matching full:call
138 bool SemaOpenCL::checkSubgroupExt(CallExpr *Call) { in checkSubgroupExt() argument
146 Diag(Call->getBeginLoc(), diag::err_opencl_requires_extension) in checkSubgroupExt()
147 << 1 << Call->getDirectCallee() in checkSubgroupExt()
364 static bool checkPipeArg(Sema &S, CallExpr *Call) { in checkPipeArg() argument
365 const Expr *Arg0 = Call->getArg(0); in checkPipeArg()
368 S.Diag(Call->getBeginLoc(), diag::err_opencl_builtin_pipe_first_arg) in checkPipeArg()
369 << Call->getDirectCallee() << Arg0->getSourceRange(); in checkPipeArg()
374 // Validates the access qualifier is compatible with the call. in checkPipeArg()
378 switch (Call->getDirectCallee()->getBuiltinID()) { in checkPipeArg()
414 static bool checkPipePacketType(Sema &S, CallExpr *Call, unsigned Idx) { in checkPipePacketType() argument
415 const Expr *Arg0 = Call->getArg(0); in checkPipePacketType()
416 const Expr *ArgIdx = Call->getArg(Idx); in checkPipePacketType()
425 S.Diag(Call->getBeginLoc(), diag::err_opencl_builtin_pipe_invalid_arg) in checkPipePacketType()
426 << Call->getDirectCallee() << S.Context.getPointerType(EltTy) in checkPipePacketType()
433 bool SemaOpenCL::checkBuiltinRWPipe(CallExpr *Call) { in checkBuiltinRWPipe() argument
436 switch (Call->getNumArgs()) { in checkBuiltinRWPipe()
438 if (checkPipeArg(SemaRef, Call)) in checkBuiltinRWPipe()
440 // The call with 2 arguments should be in checkBuiltinRWPipe()
443 if (checkPipePacketType(SemaRef, Call, 1)) in checkBuiltinRWPipe()
448 if (checkPipeArg(SemaRef, Call)) in checkBuiltinRWPipe()
450 // The call with 4 arguments should be in checkBuiltinRWPipe()
453 if (!Call->getArg(1)->getType()->isReserveIDT()) { in checkBuiltinRWPipe()
454 Diag(Call->getBeginLoc(), diag::err_opencl_builtin_pipe_invalid_arg) in checkBuiltinRWPipe()
455 << Call->getDirectCallee() << getASTContext().OCLReserveIDTy in checkBuiltinRWPipe()
456 << Call->getArg(1)->getType() << Call->getArg(1)->getSourceRange(); in checkBuiltinRWPipe()
461 const Expr *Arg2 = Call->getArg(2); in checkBuiltinRWPipe()
464 Diag(Call->getBeginLoc(), diag::err_opencl_builtin_pipe_invalid_arg) in checkBuiltinRWPipe()
465 << Call->getDirectCallee() << getASTContext().UnsignedIntTy in checkBuiltinRWPipe()
471 if (checkPipePacketType(SemaRef, Call, 3)) in checkBuiltinRWPipe()
475 Diag(Call->getBeginLoc(), diag::err_opencl_builtin_pipe_arg_num) in checkBuiltinRWPipe()
476 << Call->getDirectCallee() << Call->getSourceRange(); in checkBuiltinRWPipe()
483 bool SemaOpenCL::checkBuiltinReserveRWPipe(CallExpr *Call) { in checkBuiltinReserveRWPipe() argument
484 if (SemaRef.checkArgCount(Call, 2)) in checkBuiltinReserveRWPipe()
487 if (checkPipeArg(SemaRef, Call)) in checkBuiltinReserveRWPipe()
491 if (!Call->getArg(1)->getType()->isIntegerType() && in checkBuiltinReserveRWPipe()
492 !Call->getArg(1)->getType()->isUnsignedIntegerType()) { in checkBuiltinReserveRWPipe()
493 Diag(Call->getBeginLoc(), diag::err_opencl_builtin_pipe_invalid_arg) in checkBuiltinReserveRWPipe()
494 << Call->getDirectCallee() << getASTContext().UnsignedIntTy in checkBuiltinReserveRWPipe()
495 << Call->getArg(1)->getType() << Call->getArg(1)->getSourceRange(); in checkBuiltinReserveRWPipe()
502 Call->setType(getASTContext().OCLReserveIDTy); in checkBuiltinReserveRWPipe()
507 bool SemaOpenCL::checkBuiltinCommitRWPipe(CallExpr *Call) { in checkBuiltinCommitRWPipe() argument
508 if (SemaRef.checkArgCount(Call, 2)) in checkBuiltinCommitRWPipe()
511 if (checkPipeArg(SemaRef, Call)) in checkBuiltinCommitRWPipe()
515 if (!Call->getArg(1)->getType()->isReserveIDT()) { in checkBuiltinCommitRWPipe()
516 Diag(Call->getBeginLoc(), diag::err_opencl_builtin_pipe_invalid_arg) in checkBuiltinCommitRWPipe()
517 << Call->getDirectCallee() << getASTContext().OCLReserveIDTy in checkBuiltinCommitRWPipe()
518 << Call->getArg(1)->getType() << Call->getArg(1)->getSourceRange(); in checkBuiltinCommitRWPipe()
525 bool SemaOpenCL::checkBuiltinPipePackets(CallExpr *Call) { in checkBuiltinPipePackets() argument
526 if (SemaRef.checkArgCount(Call, 1)) in checkBuiltinPipePackets()
529 if (!Call->getArg(0)->getType()->isPipeType()) { in checkBuiltinPipePackets()
530 Diag(Call->getBeginLoc(), diag::err_opencl_builtin_pipe_first_arg) in checkBuiltinPipePackets()
531 << Call->getDirectCallee() << Call->getArg(0)->getSourceRange(); in checkBuiltinPipePackets()
538 bool SemaOpenCL::checkBuiltinToAddr(unsigned BuiltinID, CallExpr *Call) { in checkBuiltinToAddr() argument
539 if (SemaRef.checkArgCount(Call, 1)) in checkBuiltinToAddr()
542 auto RT = Call->getArg(0)->getType(); in checkBuiltinToAddr()
545 Diag(Call->getBeginLoc(), diag::err_opencl_builtin_to_addr_invalid_arg) in checkBuiltinToAddr()
546 << Call->getArg(0) << Call->getDirectCallee() << Call->getSourceRange(); in checkBuiltinToAddr()
551 Diag(Call->getArg(0)->getBeginLoc(), in checkBuiltinToAddr()
553 << Call->getDirectCallee()->getNameInfo().getAsString() in checkBuiltinToAddr()
554 << Call->getArg(0)->getSourceRange(); in checkBuiltinToAddr()
572 Call->setType(getASTContext().getPointerType( in checkBuiltinToAddr()