#include "SmartPtr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/Type.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.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/SVals.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h"
#include "llvm/ADT/StringRef.h"
usingnamespaceclang;
usingnamespaceento;
namespace {
static const BugType *NullDereferenceBugTypePtr;
class SmartPtrChecker : public Checker<check::PreCall> { … };
}
namespace clang {
namespace ento {
namespace smartptr {
const BugType *getNullDereferenceBugType() { … }
}
}
}
void SmartPtrChecker::checkPreCall(const CallEvent &Call,
CheckerContext &C) const { … }
void SmartPtrChecker::reportBug(CheckerContext &C, const MemRegion *DerefRegion,
const CallEvent &Call) const { … }
void SmartPtrChecker::explainDereference(llvm::raw_ostream &OS,
const MemRegion *DerefRegion,
const CallEvent &Call) const { … }
void ento::registerSmartPtrChecker(CheckerManager &Mgr) { … }
bool ento::shouldRegisterSmartPtrChecker(const CheckerManager &mgr) { … }