Lines Matching refs:Call

66   [[nodiscard]] bool matches(const CallEvent &Call, bool IsLock) const {  in matches()  argument
68 return LockFn.matches(Call); in matches()
70 return UnlockFn.matches(Call); in matches()
79 [[nodiscard]] const MemRegion *getRegion(const CallEvent &Call, bool) const { in getRegion() argument
80 return Call.getArgSVal(0).getAsRegion(); in getRegion()
89 [[nodiscard]] const MemRegion *getRegion(const CallEvent &Call, bool) const { in getRegion() argument
90 return cast<CXXMemberCall>(Call).getCXXThisVal().getAsRegion(); in getRegion()
99 void initIdentifierInfo(const CallEvent &Call) const { in initIdentifierInfo()
106 const auto &ASTCtx = Call.getState()->getStateManager().getContext(); in initIdentifierInfo()
111 template <typename T> bool matchesImpl(const CallEvent &Call) const { in matchesImpl()
112 const T *C = dyn_cast<T>(&Call); in matchesImpl()
122 [[nodiscard]] bool matches(const CallEvent &Call, bool IsLock) const { in matches() argument
123 initIdentifierInfo(Call); in matches()
125 return matchesImpl<CXXConstructorCall>(Call); in matches()
127 return matchesImpl<CXXDestructorCall>(Call); in matches()
129 [[nodiscard]] const MemRegion *getRegion(const CallEvent &Call, in getRegion() argument
133 if (std::optional<SVal> Object = Call.getReturnValueUnderConstruction()) { in getRegion()
137 LockRegion = cast<CXXDestructorCall>(Call).getCXXThisVal().getAsRegion(); in getRegion()
190 checkDescriptorMatch(const CallEvent &Call, CheckerContext &C,
193 void handleLock(const MutexDescriptor &Mutex, const CallEvent &Call,
196 void handleUnlock(const MutexDescriptor &Mutex, const CallEvent &Call,
199 [[nodiscard]] bool isBlockingInCritSection(const CallEvent &Call,
206 void checkPostCall(const CallEvent &Call, CheckerContext &C) const;
228 BlockInCriticalSectionChecker::checkDescriptorMatch(const CallEvent &Call, in checkDescriptorMatch() argument
232 llvm::find_if(MutexDescriptors, [&Call, IsLock](auto &&Descriptor) { in checkDescriptorMatch()
234 [&Call, IsLock](auto &&DescriptorImpl) { in checkDescriptorMatch()
235 return DescriptorImpl.matches(Call, IsLock); in checkDescriptorMatch()
244 static const MemRegion *getRegion(const CallEvent &Call, in getRegion() argument
248 [&Call, IsLock](auto &&Descriptor) { in getRegion()
249 return Descriptor.getRegion(Call, IsLock); in getRegion()
255 const MutexDescriptor &LockDescriptor, const CallEvent &Call, in handleLock() argument
258 getRegion(Call, LockDescriptor, /*IsLock=*/true); in handleLock()
262 const CritSectionMarker MarkToAdd{Call.getOriginExpr(), MutexRegion}; in handleLock()
269 const MutexDescriptor &UnlockDescriptor, const CallEvent &Call, in handleUnlock() argument
272 getRegion(Call, UnlockDescriptor, /*IsLock=*/false); in handleUnlock()
299 const CallEvent &Call, CheckerContext &C) const { in isBlockingInCritSection() argument
300 return BlockingFunctions.contains(Call) && in isBlockingInCritSection()
304 void BlockInCriticalSectionChecker::checkPostCall(const CallEvent &Call, in checkPostCall() argument
306 if (isBlockingInCritSection(Call, C)) { in checkPostCall()
307 reportBlockInCritSection(Call, C); in checkPostCall()
309 checkDescriptorMatch(Call, C, /*IsLock=*/true)) { in checkPostCall()
310 handleLock(*LockDesc, Call, C); in checkPostCall()
312 checkDescriptorMatch(Call, C, /*IsLock=*/false)) { in checkPostCall()
313 handleUnlock(*UnlockDesc, Call, C); in checkPostCall()
318 const CallEvent &Call, CheckerContext &C) const { in reportBlockInCritSection() argument
325 os << "Call to blocking function '" << Call.getCalleeIdentifier()->getName() in reportBlockInCritSection()
329 R->addRange(Call.getSourceRange()); in reportBlockInCritSection()
330 R->markInteresting(Call.getReturnValue()); in reportBlockInCritSection()