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

//===-- InvalidatedIteratorChecker.cpp ----------------------------*- 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
//
//===----------------------------------------------------------------------===//
//
// Defines a checker for access of invalidated iterators.
//
//===----------------------------------------------------------------------===//

#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.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 "Iterator.h"

usingnamespaceclang;
usingnamespaceento;
usingnamespaceiterator;

namespace {

class InvalidatedIteratorChecker
  : public Checker<check::PreCall, check::PreStmt<UnaryOperator>,
                   check::PreStmt<BinaryOperator>,
                   check::PreStmt<ArraySubscriptExpr>,
                   check::PreStmt<MemberExpr>> {};

} // namespace

void InvalidatedIteratorChecker::checkPreCall(const CallEvent &Call,
                                              CheckerContext &C) const {}

void InvalidatedIteratorChecker::checkPreStmt(const UnaryOperator *UO,
                                              CheckerContext &C) const {}

void InvalidatedIteratorChecker::checkPreStmt(const BinaryOperator *BO,
                                              CheckerContext &C) const {}

void InvalidatedIteratorChecker::checkPreStmt(const ArraySubscriptExpr *ASE,
                                              CheckerContext &C) const {}

void InvalidatedIteratorChecker::checkPreStmt(const MemberExpr *ME,
                                              CheckerContext &C) const {}

void InvalidatedIteratorChecker::verifyAccess(CheckerContext &C,
                                              SVal Val) const {}

void InvalidatedIteratorChecker::reportBug(StringRef Message, SVal Val,
                                           CheckerContext &C,
                                           ExplodedNode *ErrNode) const {}

void ento::registerInvalidatedIteratorChecker(CheckerManager &mgr) {}

bool ento::shouldRegisterInvalidatedIteratorChecker(const CheckerManager &mgr) {}