#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclObjC.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
usingnamespaceclang;
usingnamespaceento;
usingnamespaceast_matchers;
namespace {
const char * RunLoopBind = …;
const char * RunLoopRunBind = …;
const char * OtherMsgBind = …;
const char * AutoreleasePoolBind = …;
const char * OtherStmtAutoreleasePoolBind = …;
class RunLoopAutoreleaseLeakChecker : public Checker<check::ASTCodeBody> { … };
}
static bool seenBefore(const Stmt *Parent, const Stmt *A, const Stmt *B) { … }
static void emitDiagnostics(BoundNodes &Match,
const Decl *D,
BugReporter &BR,
AnalysisManager &AM,
const RunLoopAutoreleaseLeakChecker *Checker) { … }
static StatementMatcher getRunLoopRunM(StatementMatcher Extra = anything()) { … }
static StatementMatcher getOtherMessageSentM(StatementMatcher Extra = anything()) { … }
static void
checkTempObjectsInSamePool(const Decl *D, AnalysisManager &AM, BugReporter &BR,
const RunLoopAutoreleaseLeakChecker *Chkr) { … }
static void
checkTempObjectsInNoPool(const Decl *D, AnalysisManager &AM, BugReporter &BR,
const RunLoopAutoreleaseLeakChecker *Chkr) { … }
void RunLoopAutoreleaseLeakChecker::checkASTCodeBody(const Decl *D,
AnalysisManager &AM,
BugReporter &BR) const { … }
void ento::registerRunLoopAutoreleaseLeakChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterRunLoopAutoreleaseLeakChecker(const CheckerManager &mgr) { … }