Lines Matching refs:Call
52 bool isBlockingFunction(const CallEvent &Call) const;
53 bool isLockFunction(const CallEvent &Call) const;
54 bool isUnlockFunction(const CallEvent &Call) const;
59 void checkPostCall(const CallEvent &Call, CheckerContext &C) const;
99 bool BlockInCriticalSectionChecker::isBlockingFunction(const CallEvent &Call) const { in isBlockingFunction()
100 if (Call.isCalled(SleepFn) in isBlockingFunction()
101 || Call.isCalled(GetcFn) in isBlockingFunction()
102 || Call.isCalled(FgetsFn) in isBlockingFunction()
103 || Call.isCalled(ReadFn) in isBlockingFunction()
104 || Call.isCalled(RecvFn)) { in isBlockingFunction()
110 bool BlockInCriticalSectionChecker::isLockFunction(const CallEvent &Call) const { in isLockFunction()
111 if (const auto *Ctor = dyn_cast<CXXConstructorCall>(&Call)) { in isLockFunction()
117 if (Call.isCalled(LockFn) in isLockFunction()
118 || Call.isCalled(PthreadLockFn) in isLockFunction()
119 || Call.isCalled(PthreadTryLockFn) in isLockFunction()
120 || Call.isCalled(MtxLock) in isLockFunction()
121 || Call.isCalled(MtxTimedLock) in isLockFunction()
122 || Call.isCalled(MtxTryLock)) { in isLockFunction()
128 bool BlockInCriticalSectionChecker::isUnlockFunction(const CallEvent &Call) const { in isUnlockFunction()
129 if (const auto *Dtor = dyn_cast<CXXDestructorCall>(&Call)) { in isUnlockFunction()
136 if (Call.isCalled(UnlockFn) in isUnlockFunction()
137 || Call.isCalled(PthreadUnlockFn) in isUnlockFunction()
138 || Call.isCalled(MtxUnlock)) { in isUnlockFunction()
144 void BlockInCriticalSectionChecker::checkPostCall(const CallEvent &Call, in checkPostCall() argument
148 if (!isBlockingFunction(Call) in checkPostCall()
149 && !isLockFunction(Call) in checkPostCall()
150 && !isUnlockFunction(Call)) in checkPostCall()
155 if (isUnlockFunction(Call) && mutexCount > 0) { in checkPostCall()
158 } else if (isLockFunction(Call)) { in checkPostCall()
162 SymbolRef BlockDesc = Call.getReturnValue().getAsSymbol(); in checkPostCall()
163 reportBlockInCritSection(BlockDesc, Call, C); in checkPostCall()
168 SymbolRef BlockDescSym, const CallEvent &Call, CheckerContext &C) const { in reportBlockInCritSection() argument
175 os << "Call to blocking function '" << Call.getCalleeIdentifier()->getName() in reportBlockInCritSection()
178 R->addRange(Call.getSourceRange()); in reportBlockInCritSection()