clang
22.0.0git
lib
StaticAnalyzer
Frontend
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
15
#include "
clang/StaticAnalyzer/Core/Checker.h
"
16
#include "
clang/StaticAnalyzer/Core/CheckerManager.h
"
17
#include "
clang/StaticAnalyzer/Frontend/CheckerRegistry.h
"
18
#include <memory>
19
20
namespace
clang
{
21
namespace
ento
{
22
23
CheckerManager::CheckerManager
(
24
ASTContext
&Context,
AnalyzerOptions
&AOptions,
const
Preprocessor
&PP,
25
ArrayRef<std::string>
plugins,
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
36
CheckerManager::CheckerManager
(
AnalyzerOptions
&AOptions,
37
const
LangOptions
&LangOpts,
38
DiagnosticsEngine
&Diags,
39
ArrayRef<std::string>
plugins)
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.
48
CheckerManager::~CheckerManager
() =
default
;
49
50
}
// namespace ento
51
}
// namespace clang
CheckerManager.h
CheckerRegistry.h
Checker.h
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition
ASTContext.h:188
clang::AnalyzerOptions
Stores options for the analyzer from the command line.
Definition
AnalyzerOptions.h:180
clang::DiagnosticsEngine
Concrete class used by the front-end to report problems and issues.
Definition
Diagnostic.h:231
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition
LangOptions.h:434
clang::Preprocessor
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Definition
Preprocessor.h:145
clang::ento::CheckerManager::~CheckerManager
~CheckerManager()
clang::ento::CheckerManager::getDiagnostics
DiagnosticsEngine & getDiagnostics() const
Definition
CheckerManager.h:176
clang::ento::CheckerManager::CheckerManager
CheckerManager(ASTContext &Context, AnalyzerOptions &AOptions, const Preprocessor &PP, ArrayRef< std::string > plugins, ArrayRef< std::function< void(CheckerRegistry &)> > checkerRegistrationFns)
Definition
CreateCheckerManager.cpp:23
clang::ento::CheckerManager::getLangOpts
const LangOptions & getLangOpts() const
Definition
CheckerManager.h:167
clang::ento::CheckerRegistry
Manages a set of available checkers for running a static analysis.
Definition
CheckerRegistry.h:89
clang::ento::CheckerRegistry::initializeRegistry
void initializeRegistry(const CheckerManager &Mgr)
Collects all enabled checkers in the field EnabledCheckers.
Definition
CheckerRegistry.cpp:203
llvm::ArrayRef
Definition
LLVM.h:31
clang::ento
Definition
CocoaConventions.h:23
clang
The JSON file list parser is used to communicate input to InstallAPI.
Definition
CalledOnceCheck.h:17
std
Definition
__clang_cuda_cmath.h:361
std::function
int const char * function
Definition
c++config.h:31
clang::ento::CheckerRegistryData
Definition
CheckerRegistryData.h:193
Generated on
for clang by
1.14.0