#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/AST/ParentMap.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/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
usingnamespaceclang;
usingnamespaceento;
namespace {
class ObjCContainersChecker : public Checker< check::PreStmt<CallExpr>,
check::PostStmt<CallExpr>,
check::PointerEscape> { … };
}
REGISTER_MAP_WITH_PROGRAMSTATE(…)
void ObjCContainersChecker::addSizeInfo(const Expr *Array, const Expr *Size,
CheckerContext &C) const { … }
void ObjCContainersChecker::checkPostStmt(const CallExpr *CE,
CheckerContext &C) const { … }
void ObjCContainersChecker::checkPreStmt(const CallExpr *CE,
CheckerContext &C) const { … }
ProgramStateRef
ObjCContainersChecker::checkPointerEscape(ProgramStateRef State,
const InvalidatedSymbols &Escaped,
const CallEvent *Call,
PointerEscapeKind Kind) const { … }
void ObjCContainersChecker::printState(raw_ostream &OS, ProgramStateRef State,
const char *NL, const char *Sep) const { … }
void ento::registerObjCContainersChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterObjCContainersChecker(const CheckerManager &mgr) { … }