#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.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/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
usingnamespaceclang;
usingnamespaceento;
namespace {
class CXXDeleteChecker : public Checker<check::PreStmt<CXXDeleteExpr>> { … };
class DeleteWithNonVirtualDtorChecker : public CXXDeleteChecker { … };
class CXXArrayDeleteChecker : public CXXDeleteChecker { … };
}
void CXXDeleteChecker::checkPreStmt(const CXXDeleteExpr *DE,
CheckerContext &C) const { … }
void DeleteWithNonVirtualDtorChecker::checkTypedDeleteExpr(
const CXXDeleteExpr *DE, CheckerContext &C,
const TypedValueRegion *BaseClassRegion,
const SymbolicRegion *DerivedClassRegion) const { … }
void CXXArrayDeleteChecker::checkTypedDeleteExpr(
const CXXDeleteExpr *DE, CheckerContext &C,
const TypedValueRegion *BaseClassRegion,
const SymbolicRegion *DerivedClassRegion) const { … }
PathDiagnosticPieceRef
CXXDeleteChecker::PtrCastVisitor::VisitNode(const ExplodedNode *N,
BugReporterContext &BRC,
PathSensitiveBugReport &BR) { … }
void ento::registerArrayDeleteChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterArrayDeleteChecker(const CheckerManager &mgr) { … }
void ento::registerDeleteWithNonVirtualDtorChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterDeleteWithNonVirtualDtorChecker(
const CheckerManager &mgr) { … }