#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicExtent.h"
#include "llvm/Support/FormatVariadic.h"
usingnamespaceclang;
usingnamespaceento;
namespace {
class PlacementNewChecker : public Checker<check::PreStmt<CXXNewExpr>> { … };
}
SVal PlacementNewChecker::getExtentSizeOfPlace(const CXXNewExpr *NE,
CheckerContext &C) const { … }
SVal PlacementNewChecker::getExtentSizeOfNewTarget(const CXXNewExpr *NE,
CheckerContext &C,
bool &IsArray) const { … }
bool PlacementNewChecker::checkPlaceCapacityIsSufficient(
const CXXNewExpr *NE, CheckerContext &C) const { … }
void PlacementNewChecker::emitBadAlignReport(const Expr *P, CheckerContext &C,
unsigned AllocatedTAlign,
unsigned StorageTAlign) const { … }
unsigned PlacementNewChecker::getStorageAlign(CheckerContext &C,
const ValueDecl *VD) const { … }
void PlacementNewChecker::checkElementRegionAlign(
const ElementRegion *R, CheckerContext &C, const Expr *P,
unsigned AllocatedTAlign) const { … }
void PlacementNewChecker::checkFieldRegionAlign(
const FieldRegion *R, CheckerContext &C, const Expr *P,
unsigned AllocatedTAlign) const { … }
bool PlacementNewChecker::isVarRegionAlignedProperly(
const VarRegion *R, CheckerContext &C, const Expr *P,
unsigned AllocatedTAlign) const { … }
bool PlacementNewChecker::checkPlaceIsAlignedProperly(const CXXNewExpr *NE,
CheckerContext &C) const { … }
void PlacementNewChecker::checkPreStmt(const CXXNewExpr *NE,
CheckerContext &C) const { … }
void ento::registerPlacementNewChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterPlacementNewChecker(const CheckerManager &mgr) { … }