clang 22.0.0git
CreateCheckerManager.cpp
Go to the documentation of this file.
1//===- CreateCheckerManager.cpp - Checker Manager constructor ---*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Defines the constructors and the destructor of the Static Analyzer Checker
10// Manager which cannot be placed under 'Core' because they depend on the
11// CheckerRegistry.
12//
13//===----------------------------------------------------------------------===//
14
18#include <memory>
19
20namespace clang {
21namespace ento {
22
24 ASTContext &Context, AnalyzerOptions &AOptions, const Preprocessor &PP,
26 ArrayRef<std::function<void(CheckerRegistry &)>> checkerRegistrationFns)
27 : Context(&Context), LangOpts(Context.getLangOpts()), AOptions(AOptions),
28 PP(&PP), Diags(Context.getDiagnostics()),
29 RegistryData(std::make_unique<CheckerRegistryData>()) {
30 CheckerRegistry Registry(*RegistryData, plugins, Context.getDiagnostics(),
31 AOptions, checkerRegistrationFns);
32 Registry.initializeRegistry(*this);
33 Registry.initializeManager(*this);
34}
35
37 const LangOptions &LangOpts,
38 DiagnosticsEngine &Diags,
40 : LangOpts(LangOpts), AOptions(AOptions), Diags(Diags),
41 RegistryData(std::make_unique<CheckerRegistryData>()) {
42 CheckerRegistry Registry(*RegistryData, plugins, Diags, AOptions, {});
43 Registry.initializeRegistry(*this);
44}
45
46// This is declared here to ensure that the destructors of `CheckerBase` and
47// `CheckerRegistryData` are available.
49
50} // namespace ento
51} // namespace clang
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:188
Stores options for the analyzer from the command line.
Concrete class used by the front-end to report problems and issues.
Definition Diagnostic.h:231
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
DiagnosticsEngine & getDiagnostics() const
CheckerManager(ASTContext &Context, AnalyzerOptions &AOptions, const Preprocessor &PP, ArrayRef< std::string > plugins, ArrayRef< std::function< void(CheckerRegistry &)> > checkerRegistrationFns)
const LangOptions & getLangOpts() const
Manages a set of available checkers for running a static analysis.
void initializeRegistry(const CheckerManager &Mgr)
Collects all enabled checkers in the field EnabledCheckers.
The JSON file list parser is used to communicate input to InstallAPI.
int const char * function
Definition c++config.h:31