Lines Matching defs:Call

67   [[nodiscard]] bool matches(const CallEvent &Call, bool IsLock) const {
69 return LockFn.matches(Call);
71 return UnlockFn.matches(Call);
80 [[nodiscard]] const MemRegion *getRegion(const CallEvent &Call, bool) const {
81 return Call.getArgSVal(0).getAsRegion();
90 [[nodiscard]] const MemRegion *getRegion(const CallEvent &Call, bool) const {
91 return cast<CXXMemberCall>(Call).getCXXThisVal().getAsRegion();
100 void initIdentifierInfo(const CallEvent &Call) const {
107 const auto &ASTCtx = Call.getState()->getStateManager().getContext();
112 template <typename T> bool matchesImpl(const CallEvent &Call) const {
113 const T *C = dyn_cast<T>(&Call);
123 [[nodiscard]] bool matches(const CallEvent &Call, bool IsLock) const {
124 initIdentifierInfo(Call);
126 return matchesImpl<CXXConstructorCall>(Call);
128 return matchesImpl<CXXDestructorCall>(Call);
130 [[nodiscard]] const MemRegion *getRegion(const CallEvent &Call,
134 if (std::optional<SVal> Object = Call.getReturnValueUnderConstruction()) {
138 LockRegion = cast<CXXDestructorCall>(Call).getCXXThisVal().getAsRegion();
183 this, "Call to blocking function in critical section", "Blocking Error"};
191 checkDescriptorMatch(const CallEvent &Call, CheckerContext &C,
194 void handleLock(const MutexDescriptor &Mutex, const CallEvent &Call,
197 void handleUnlock(const MutexDescriptor &Mutex, const CallEvent &Call,
200 [[nodiscard]] bool isBlockingInCritSection(const CallEvent &Call,
207 void checkPostCall(const CallEvent &Call, CheckerContext &C) const;
229 BlockInCriticalSectionChecker::checkDescriptorMatch(const CallEvent &Call,
233 llvm::find_if(MutexDescriptors, [&Call, IsLock](auto &&Descriptor) {
235 [&Call, IsLock](auto &&DescriptorImpl) {
236 return DescriptorImpl.matches(Call, IsLock);
255 static const MemRegion *getRegion(const CallEvent &Call,
259 [&Call, IsLock](auto &Descr) -> const MemRegion * {
260 return skipStdBaseClassRegion(Descr.getRegion(Call, IsLock));
266 const MutexDescriptor &LockDescriptor, const CallEvent &Call,
269 getRegion(Call, LockDescriptor, /*IsLock=*/true);
273 const CritSectionMarker MarkToAdd{Call.getOriginExpr(), MutexRegion};
280 const MutexDescriptor &UnlockDescriptor, const CallEvent &Call,
283 getRegion(Call, UnlockDescriptor, /*IsLock=*/false);
310 const CallEvent &Call, CheckerContext &C) const {
311 return BlockingFunctions.contains(Call) &&
315 void BlockInCriticalSectionChecker::checkPostCall(const CallEvent &Call,
317 if (isBlockingInCritSection(Call, C)) {
318 reportBlockInCritSection(Call, C);
320 checkDescriptorMatch(Call, C, /*IsLock=*/true)) {
321 handleLock(*LockDesc, Call, C);
323 checkDescriptorMatch(Call, C, /*IsLock=*/false)) {
324 handleUnlock(*UnlockDesc, Call, C);
329 const CallEvent &Call, CheckerContext &C) const {
336 os << "Call to blocking function '" << Call.getCalleeIdentifier()->getName()
340 R->addRange(Call.getSourceRange());
341 R->markInteresting(Call.getReturnValue());