#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "Iterator.h"
usingnamespaceclang;
usingnamespaceento;
usingnamespaceiterator;
namespace {
class InvalidatedIteratorChecker
: public Checker<check::PreCall, check::PreStmt<UnaryOperator>,
check::PreStmt<BinaryOperator>,
check::PreStmt<ArraySubscriptExpr>,
check::PreStmt<MemberExpr>> { … };
}
void InvalidatedIteratorChecker::checkPreCall(const CallEvent &Call,
CheckerContext &C) const { … }
void InvalidatedIteratorChecker::checkPreStmt(const UnaryOperator *UO,
CheckerContext &C) const { … }
void InvalidatedIteratorChecker::checkPreStmt(const BinaryOperator *BO,
CheckerContext &C) const { … }
void InvalidatedIteratorChecker::checkPreStmt(const ArraySubscriptExpr *ASE,
CheckerContext &C) const { … }
void InvalidatedIteratorChecker::checkPreStmt(const MemberExpr *ME,
CheckerContext &C) const { … }
void InvalidatedIteratorChecker::verifyAccess(CheckerContext &C,
SVal Val) const { … }
void InvalidatedIteratorChecker::reportBug(StringRef Message, SVal Val,
CheckerContext &C,
ExplodedNode *ErrNode) const { … }
void ento::registerInvalidatedIteratorChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterInvalidatedIteratorChecker(const CheckerManager &mgr) { … }