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

//===- AnalysisOrderChecker - Print callbacks called ------------*- 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 checker prints callbacks that are called during analysis.
// This is required to ensure that callbacks are fired in order
// and do not duplicate or get lost.
// Feel free to extend this checker with any callback you need to check.
//
//===----------------------------------------------------------------------===//

#include "clang/AST/ExprCXX.h"
#include "clang/Analysis/CFGStmtMap.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.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 "llvm/Support/ErrorHandling.h"

usingnamespaceclang;
usingnamespaceento;

namespace {

class AnalysisOrderChecker
    : public Checker<
          check::PreStmt<CastExpr>, check::PostStmt<CastExpr>,
          check::PreStmt<ArraySubscriptExpr>,
          check::PostStmt<ArraySubscriptExpr>, check::PreStmt<CXXNewExpr>,
          check::PostStmt<CXXNewExpr>, check::PreStmt<CXXDeleteExpr>,
          check::PostStmt<CXXDeleteExpr>, check::PreStmt<CXXConstructExpr>,
          check::PostStmt<CXXConstructExpr>, check::PreStmt<OffsetOfExpr>,
          check::PostStmt<OffsetOfExpr>, check::PreCall, check::PostCall,
          check::EndFunction, check::EndAnalysis, check::NewAllocator,
          check::Bind, check::PointerEscape, check::RegionChanges,
          check::LiveSymbols, eval::Call> {};
} // end anonymous namespace

//===----------------------------------------------------------------------===//
// Registration.
//===----------------------------------------------------------------------===//

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

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