#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 MismatchedIteratorChecker
: public Checker<check::PreCall, check::PreStmt<BinaryOperator>> { … };
}
void MismatchedIteratorChecker::checkPreCall(const CallEvent &Call,
CheckerContext &C) const { … }
void MismatchedIteratorChecker::checkPreStmt(const BinaryOperator *BO,
CheckerContext &C) const { … }
void MismatchedIteratorChecker::verifyMatch(CheckerContext &C, SVal Iter,
const MemRegion *Cont) const { … }
void MismatchedIteratorChecker::verifyMatch(CheckerContext &C, SVal Iter1,
SVal Iter2) const { … }
void MismatchedIteratorChecker::reportBug(StringRef Message, SVal Val1,
SVal Val2, CheckerContext &C,
ExplodedNode *ErrNode) const { … }
void MismatchedIteratorChecker::reportBug(StringRef Message, SVal Val,
const MemRegion *Reg,
CheckerContext &C,
ExplodedNode *ErrNode) const { … }
void ento::registerMismatchedIteratorChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterMismatchedIteratorChecker(const CheckerManager &mgr) { … }