#include "clang/AST/Attr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.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/ProgramStateTrait.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h"
usingnamespaceclang;
usingnamespaceento;
namespace {
enum class ObjectState : bool { … };
}
namespace llvm {
template <> struct FoldingSetTrait<ObjectState> { … };
}
namespace {
class VirtualCallChecker
: public Checker<check::BeginFunction, check::EndFunction, check::PreCall> { … };
}
REGISTER_MAP_WITH_PROGRAMSTATE(…) …
static bool isVirtualCall(const CallExpr *CE) { … }
void VirtualCallChecker::checkBeginFunction(CheckerContext &C) const { … }
void VirtualCallChecker::checkEndFunction(const ReturnStmt *RS,
CheckerContext &C) const { … }
void VirtualCallChecker::checkPreCall(const CallEvent &Call,
CheckerContext &C) const { … }
void VirtualCallChecker::registerCtorDtorCallInState(bool IsBeginFunction,
CheckerContext &C) const { … }
void ento::registerVirtualCallModeling(CheckerManager &Mgr) { … }
void ento::registerPureVirtualCallChecker(CheckerManager &Mgr) { … }
void ento::registerVirtualCallChecker(CheckerManager &Mgr) { … }
bool ento::shouldRegisterVirtualCallModeling(const CheckerManager &mgr) { … }
bool ento::shouldRegisterPureVirtualCallChecker(const CheckerManager &mgr) { … }
bool ento::shouldRegisterVirtualCallChecker(const CheckerManager &mgr) { … }