#include "AllocationState.h"
#include "InterCheckerAPI.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
usingnamespaceclang;
usingnamespaceento;
REGISTER_SET_FACTORY_WITH_PROGRAMSTATE(…)
REGISTER_MAP_WITH_PROGRAMSTATE(…) …
namespace {
class InnerPointerChecker
: public Checker<check::DeadSymbols, check::PostCall> { … };
}
bool InnerPointerChecker::isInvalidatingMemberFunction(
const CallEvent &Call) const { … }
void InnerPointerChecker::markPtrSymbolsReleased(const CallEvent &Call,
ProgramStateRef State,
const MemRegion *MR,
CheckerContext &C) const { … }
void InnerPointerChecker::checkFunctionArguments(const CallEvent &Call,
ProgramStateRef State,
CheckerContext &C) const { … }
void InnerPointerChecker::checkPostCall(const CallEvent &Call,
CheckerContext &C) const { … }
void InnerPointerChecker::checkDeadSymbols(SymbolReaper &SymReaper,
CheckerContext &C) const { … }
namespace clang {
namespace ento {
namespace allocation_state {
std::unique_ptr<BugReporterVisitor> getInnerPointerBRVisitor(SymbolRef Sym) { … }
const MemRegion *getContainerObjRegion(ProgramStateRef State, SymbolRef Sym) { … }
}
}
}
PathDiagnosticPieceRef InnerPointerChecker::InnerPointerBRVisitor::VisitNode(
const ExplodedNode *N, BugReporterContext &BRC, PathSensitiveBugReport &) { … }
void ento::registerInnerPointerChecker(CheckerManager &Mgr) { … }
bool ento::shouldRegisterInnerPointerChecker(const CheckerManager &mgr) { … }