llvm/clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp

//==- CheckPlacementNew.cpp - Check for placement new operation --*- C++ -*-==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
//  This file defines a check for misuse of the default placement new operator.
//
//===----------------------------------------------------------------------===//

#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>> {};
} // namespace

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) {}