Lines Matching full:call

34 class CastValueChecker : public Checker<check::DeadSymbols, eval::Call> {
38 std::function<void(const CastValueChecker *, const CallEvent &Call,
54 bool evalCall(const CallEvent &Call, CheckerContext &C) const;
59 // {{match-mode, {namespace, call}, argument-count}, {callback, kind}}
78 void evalCast(const CallEvent &Call, DefinedOrUnknownSVal DV,
80 void evalDynCast(const CallEvent &Call, DefinedOrUnknownSVal DV,
82 void evalCastOrNull(const CallEvent &Call, DefinedOrUnknownSVal DV,
84 void evalDynCastOrNull(const CallEvent &Call, DefinedOrUnknownSVal DV,
86 void evalCastAs(const CallEvent &Call, DefinedOrUnknownSVal DV,
88 void evalGetAs(const CallEvent &Call, DefinedOrUnknownSVal DV,
90 void evalIsa(const CallEvent &Call, DefinedOrUnknownSVal DV,
92 void evalIsaAndNonNull(const CallEvent &Call, DefinedOrUnknownSVal DV,
198 static void addCastTransition(const CallEvent &Call, DefinedOrUnknownSVal DV, in addCastTransition() argument
208 QualType CastToTy = Call.getResultType(); in addCastTransition()
210 if (Call.getNumArgs() > 0) { in addCastTransition()
211 Object = Call.getArgExpr(0); in addCastTransition()
212 CastFromTy = Call.parameters()[0]->getType(); in addCastTransition()
214 Object = cast<CXXInstanceCall>(&Call)->getCXXThisExpr(); in addCastTransition()
255 State->BindExpr(Call.getOriginExpr(), C.getLocationContext(), V, false), in addCastTransition()
259 static void addInstanceOfTransition(const CallEvent &Call, in addInstanceOfTransition() argument
263 const FunctionDecl *FD = Call.getDecl()->getAsFunction(); in addInstanceOfTransition()
264 QualType CastFromTy = Call.parameters()[0]->getType(); in addInstanceOfTransition()
317 NewState->BindExpr(Call.getOriginExpr(), C.getLocationContext(), in addInstanceOfTransition()
319 getNoteTag(C, CastInfo, CastToTy, Call.getArgExpr(0), true, in addInstanceOfTransition()
331 State->BindExpr(Call.getOriginExpr(), C.getLocationContext(), in addInstanceOfTransition()
333 getNoteTag(C, CastToTyVec, Call.getArgExpr(0), IsAnyKnown)); in addInstanceOfTransition()
341 static void evalNonNullParamNonNullReturn(const CallEvent &Call, in evalNonNullParamNonNullReturn() argument
345 addCastTransition(Call, DV, C, /*IsNonNullParam=*/true, in evalNonNullParamNonNullReturn()
349 static void evalNonNullParamNullReturn(const CallEvent &Call, in evalNonNullParamNullReturn() argument
352 addCastTransition(Call, DV, C, /*IsNonNullParam=*/true, in evalNonNullParamNullReturn()
356 static void evalNullParamNullReturn(const CallEvent &Call, in evalNullParamNullReturn() argument
360 C.addTransition(State->BindExpr(Call.getOriginExpr(), in evalNullParamNullReturn()
363 Call.getOriginExpr()->getType()), in evalNullParamNullReturn()
369 void CastValueChecker::evalCast(const CallEvent &Call, DefinedOrUnknownSVal DV, in evalCast() argument
371 evalNonNullParamNonNullReturn(Call, DV, C, /*IsCheckedCast=*/true); in evalCast()
374 void CastValueChecker::evalDynCast(const CallEvent &Call, in evalDynCast() argument
377 evalNonNullParamNonNullReturn(Call, DV, C); in evalDynCast()
378 evalNonNullParamNullReturn(Call, DV, C); in evalDynCast()
381 void CastValueChecker::evalCastOrNull(const CallEvent &Call, in evalCastOrNull() argument
384 evalNonNullParamNonNullReturn(Call, DV, C); in evalCastOrNull()
385 evalNullParamNullReturn(Call, DV, C); in evalCastOrNull()
388 void CastValueChecker::evalDynCastOrNull(const CallEvent &Call, in evalDynCastOrNull() argument
391 evalNonNullParamNonNullReturn(Call, DV, C); in evalDynCastOrNull()
392 evalNonNullParamNullReturn(Call, DV, C); in evalDynCastOrNull()
393 evalNullParamNullReturn(Call, DV, C); in evalDynCastOrNull()
400 static void evalZeroParamNonNullReturn(const CallEvent &Call, in evalZeroParamNonNullReturn() argument
404 addCastTransition(Call, DV, C, /*IsNonNullParam=*/true, in evalZeroParamNonNullReturn()
408 static void evalZeroParamNullReturn(const CallEvent &Call, in evalZeroParamNullReturn() argument
411 addCastTransition(Call, DV, C, /*IsNonNullParam=*/true, in evalZeroParamNullReturn()
415 void CastValueChecker::evalCastAs(const CallEvent &Call, in evalCastAs() argument
418 evalZeroParamNonNullReturn(Call, DV, C, /*IsCheckedCast=*/true); in evalCastAs()
421 void CastValueChecker::evalGetAs(const CallEvent &Call, DefinedOrUnknownSVal DV, in evalGetAs() argument
423 evalZeroParamNonNullReturn(Call, DV, C); in evalGetAs()
424 evalZeroParamNullReturn(Call, DV, C); in evalGetAs()
431 void CastValueChecker::evalIsa(const CallEvent &Call, DefinedOrUnknownSVal DV, in evalIsa() argument
437 addInstanceOfTransition(Call, DV, NonNullState, C, /*IsInstanceOf=*/true); in evalIsa()
438 addInstanceOfTransition(Call, DV, NonNullState, C, /*IsInstanceOf=*/false); in evalIsa()
446 void CastValueChecker::evalIsaAndNonNull(const CallEvent &Call, in evalIsaAndNonNull() argument
453 addInstanceOfTransition(Call, DV, NonNullState, C, /*IsInstanceOf=*/true); in evalIsaAndNonNull()
454 addInstanceOfTransition(Call, DV, NonNullState, C, /*IsInstanceOf=*/false); in evalIsaAndNonNull()
458 addInstanceOfTransition(Call, DV, NullState, C, /*IsInstanceOf=*/false); in evalIsaAndNonNull()
463 // Main logic to evaluate a call.
466 bool CastValueChecker::evalCall(const CallEvent &Call, in evalCall() argument
468 const auto *Lookup = CDM.lookup(Call); in evalCall()
482 QualType ParamT = Call.parameters()[0]->getType(); in evalCall()
483 QualType ResultT = Call.getResultType(); in evalCall()
489 DV = Call.getArgSVal(0).getAs<DefinedOrUnknownSVal>(); in evalCall()
494 const FunctionDecl *FD = Call.getDecl()->getAsFunction(); in evalCall()
498 DV = Call.getArgSVal(0).getAs<DefinedOrUnknownSVal>(); in evalCall()
502 const auto *InstanceCall = dyn_cast<CXXInstanceCall>(&Call); in evalCall()
513 Check(this, Call, *DV, C); in evalCall()