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

//===- CheckerDocumentation.cpp - Documentation checker ---------*- 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 lists all the checker callbacks and provides documentation for
// checker writers.
//
//===----------------------------------------------------------------------===//

#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"

usingnamespaceclang;
usingnamespaceento;

// All checkers should be placed into anonymous namespace.
// We place the CheckerDocumentation inside ento namespace to make the
// it visible in doxygen.
namespace clang {
namespace ento {

/// This checker documents the callback functions checkers can use to implement
/// the custom handling of the specific events during path exploration as well
/// as reporting bugs. Most of the callbacks are targeted at path-sensitive
/// checking.
///
/// \sa CheckerContext
class CheckerDocumentation
    : public Checker<
          // clang-format off
          check::ASTCodeBody,
          check::ASTDecl<FunctionDecl>,
          check::BeginFunction,
          check::Bind,
          check::BranchCondition,
          check::ConstPointerEscape,
          check::DeadSymbols,
          check::EndAnalysis,
          check::EndFunction,
          check::EndOfTranslationUnit,
          check::Event<ImplicitNullDerefEvent>,
          check::LiveSymbols,
          check::Location,
          check::NewAllocator,
          check::ObjCMessageNil,
          check::PointerEscape,
          check::PostCall,
          check::PostObjCMessage,
          check::PostStmt<DeclStmt>,
          check::PreCall,
          check::PreObjCMessage,
          check::PreStmt<ReturnStmt>,
          check::RegionChanges,
          eval::Assume,
          eval::Call
          // clang-format on
          > {};

void CheckerDocumentation::checkPostStmt(const DeclStmt *DS,
                                         CheckerContext &C) const {}

void registerCheckerDocumentationChecker(CheckerManager &Mgr) {}

bool shouldRegisterCheckerDocumentationChecker(const CheckerManager &) {}

} // end namespace ento
} // end namespace clang