#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 "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
usingnamespaceclang;
usingnamespaceento;
namespace {
class ObjCSuperDeallocChecker
: public Checker<check::PostObjCMessage, check::PreObjCMessage,
check::PreCall, check::Location> { … };
}
REGISTER_SET_WITH_PROGRAMSTATE(…)
namespace {
class SuperDeallocBRVisitor final : public BugReporterVisitor { … };
}
void ObjCSuperDeallocChecker::checkPreObjCMessage(const ObjCMethodCall &M,
CheckerContext &C) const { … }
void ObjCSuperDeallocChecker::checkPreCall(const CallEvent &Call,
CheckerContext &C) const { … }
void ObjCSuperDeallocChecker::checkPostObjCMessage(const ObjCMethodCall &M,
CheckerContext &C) const { … }
void ObjCSuperDeallocChecker::checkLocation(SVal L, bool IsLoad, const Stmt *S,
CheckerContext &C) const { … }
void ObjCSuperDeallocChecker::reportUseAfterDealloc(SymbolRef Sym,
StringRef Desc,
const Stmt *S,
CheckerContext &C) const { … }
void ObjCSuperDeallocChecker::diagnoseCallArguments(const CallEvent &CE,
CheckerContext &C) const { … }
void
ObjCSuperDeallocChecker::initIdentifierInfoAndSelectors(ASTContext &Ctx) const { … }
bool
ObjCSuperDeallocChecker::isSuperDeallocMessage(const ObjCMethodCall &M) const { … }
PathDiagnosticPieceRef
SuperDeallocBRVisitor::VisitNode(const ExplodedNode *Succ,
BugReporterContext &BRC,
PathSensitiveBugReport &) { … }
void ento::registerObjCSuperDeallocChecker(CheckerManager &Mgr) { … }
bool ento::shouldRegisterObjCSuperDeallocChecker(const CheckerManager &mgr) { … }