Lines Matching defs:Call
87 // to report double call warnings even if these two calls are not guaranteed
96 // violations take place, we prefer to report ONLY double call. It's always
100 // a double call, we need another kind: `Reported`.
103 // developers only use tracked parameters to call them, in the real world,
110 // Some of the paths in the analyzed functions might end with a call
172 assert(!seenAnyCalls(K) && "Can't initialize status without a call");
174 ParameterStatus(Kind K, const Expr *Call) : StatusKind(K), Call(Call) {
175 assert(seenAnyCalls(K) && "This kind is not supposed to have a call");
179 assert(seenAnyCalls(getKind()) && "ParameterStatus doesn't have a call");
180 return *Call;
195 // which call we report.
198 if (!Call) {
199 Call = Other.Call;
215 const Expr *Call = nullptr;
236 /// Return a reference that we consider a call.
323 // Function pointer/references can be dereferenced before a call.
324 // That doesn't make it, however, any different from a regular call.
708 // The most natural way to report lacking call in the block #3 would be to
710 // have a call. And while with the forward approach we'll need to find a
830 // where the user doesn't call or use parameter in question.
856 // to report it, it is still a path without a call.
870 /// Check potential call of a tracked parameter.
871 void checkDirectCall(const CallExpr *Call) {
872 if (auto Index = getIndexOfCallee(Call)) {
873 processCallFor(*Index, Call);
877 /// Check the call expression for being an indirect call of one of the tracked
878 /// parameters. It is indirect in the sense that this particular call is not
886 // Let's check if any of the call arguments is a point of interest.
891 // consider it as a call.
903 /// Process call of the parameter with the given index
904 void processCallFor(unsigned Index, const Expr *Call) {
909 // At this point, this parameter was called, so this is a second call.
912 Parameter, &CurrentState.getCallFor(Index), Call,
914 // We are sure that the second call is definitely
925 ParameterStatus Called(ParameterStatus::DefinitelyCalled, Call);
1095 bool shouldBeCalledOnce(const CallExpr *Call, unsigned ParamIndex) const {
1096 const FunctionDecl *Function = Call->getDirectCallee();
1118 // Return a call site where the block is called exactly once or null otherwise
1123 // we simply see how the block used and if it's used directly in a call,
1124 // we decide based on call to what it is.
1127 // a call or a message expressions. These might not be immediate parents
1136 // call.
1137 if (const auto *Call = dyn_cast<CallExpr>(Current)) {
1138 // It might be the call of the Block itself...
1139 if (Call->getCallee() == Prev)
1140 return Call;
1142 // ...or it can be an indirect call of the block.
1143 return shouldBlockArgumentBeCalledOnce(Call, Prev) ? Call : nullptr;
1172 bool shouldBlockArgumentBeCalledOnce(const CallExpr *Call,
1174 const FunctionDecl *Function = Call->getDirectCallee();
1176 shouldBeCalledOnce(Call, ParamIndex);
1206 /// These functions can have tracked parameters, but wouldn't call them
1211 /// 2. Methods that have one block with a call to no return function
1405 // not to call completion handlers in some scenarios. These usually have
1531 void VisitCallExpr(const CallExpr *Call) {
1532 // This call might be a direct call, i.e. a parameter call...
1533 checkDirectCall(Call);
1534 // ... or an indirect call, i.e. when parameter is an argument.
1535 checkIndirectCall(Call);
1559 // Here, we try to find a call expression where we know due to conventions,
1577 // The call site of a block can be considered a call site of the
1582 // if we don't know about its call site or the number of time it
1631 // It is OK not to call marked parameters on exceptional paths.
1638 llvm::Optional<unsigned> getIndexOfCallee(const CallExpr *Call) const {
1639 return getIndexOfExpression(Call->getCallee());
1687 // It is possible to use it, however, to call tracked parameters on all exits