clang
15.0.0git
include
clang
StaticAnalyzer
Frontend
AnalysisConsumer.h
Go to the documentation of this file.
1
//===--- AnalysisConsumer.h - Front-end Analysis Engine Hooks ---*- 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
// This header contains the functions necessary for a front-end to run various
10
// analyses.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CLANG_STATICANALYZER_FRONTEND_ANALYSISCONSUMER_H
15
#define LLVM_CLANG_STATICANALYZER_FRONTEND_ANALYSISCONSUMER_H
16
17
#include "
clang/AST/ASTConsumer.h
"
18
#include "
clang/Basic/LLVM.h
"
19
#include <functional>
20
#include <memory>
21
22
namespace
clang
{
23
24
class
CompilerInstance;
25
26
namespace
ento {
27
class
PathDiagnosticConsumer;
28
class
CheckerRegistry;
29
30
class
AnalysisASTConsumer
:
public
ASTConsumer
{
31
public
:
32
virtual
void
AddDiagnosticConsumer
(
PathDiagnosticConsumer
*Consumer) = 0;
33
34
/// This method allows registering statically linked custom checkers that are
35
/// not a part of the Clang tree. It employs the same mechanism that is used
36
/// by plugins.
37
///
38
/// Example:
39
///
40
/// Consumer->AddCheckerRegistrationFn([] (CheckerRegistry& Registry) {
41
/// Registry.addChecker<MyCustomChecker>("example.MyCustomChecker",
42
/// "Description");
43
/// });
44
virtual
void
45
AddCheckerRegistrationFn
(std::function<
void
(
CheckerRegistry
&)> Fn) = 0;
46
};
47
48
/// CreateAnalysisConsumer - Creates an ASTConsumer to run various code
49
/// analysis passes. (The set of analyses run is controlled by command-line
50
/// options.)
51
std::unique_ptr<AnalysisASTConsumer>
52
CreateAnalysisConsumer
(
CompilerInstance
&CI);
53
54
}
// namespace ento
55
56
}
// end clang namespace
57
58
#endif
clang::ento::AnalysisASTConsumer::AddDiagnosticConsumer
virtual void AddDiagnosticConsumer(PathDiagnosticConsumer *Consumer)=0
clang::ento::AnalysisASTConsumer::AddCheckerRegistrationFn
virtual void AddCheckerRegistrationFn(std::function< void(CheckerRegistry &)> Fn)=0
This method allows registering statically linked custom checkers that are not a part of the Clang tre...
clang::ASTConsumer
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs.
Definition:
ASTConsumer.h:33
clang::ento::PathDiagnosticConsumer
Definition:
PathDiagnostic.h:92
clang::CompilerInstance
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Definition:
CompilerInstance.h:72
LLVM.h
ASTConsumer.h
clang::ento::AnalysisASTConsumer
Definition:
AnalysisConsumer.h:30
clang::ento::CreateAnalysisConsumer
std::unique_ptr< AnalysisASTConsumer > CreateAnalysisConsumer(CompilerInstance &CI)
CreateAnalysisConsumer - Creates an ASTConsumer to run various code analysis passes.
Definition:
AnalysisConsumer.cpp:764
clang
Definition:
CalledOnceCheck.h:17
clang::ento::CheckerRegistry
Manages a set of available checkers for running a static analysis.
Definition:
CheckerRegistry.h:89
Generated on Fri May 20 2022 02:00:44 for clang by
1.8.17