clang 22.0.0git
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
18#include "clang/Basic/LLVM.h"
19#include <functional>
20#include <memory>
21
22namespace clang {
23
25
26namespace ento {
28class CheckerRegistry;
29
31public:
32 virtual void
33 AddDiagnosticConsumer(std::unique_ptr<PathDiagnosticConsumer> Consumer) = 0;
34
35 /// This method allows registering statically linked custom checkers that are
36 /// not a part of the Clang tree. It employs the same mechanism that is used
37 /// by plugins.
38 ///
39 /// Example:
40 ///
41 /// Consumer->AddCheckerRegistrationFn([] (CheckerRegistry& Registry) {
42 /// Registry.addChecker<MyCustomChecker>("example.MyCustomChecker",
43 /// "Description");
44 /// });
45 virtual void
47};
48
49/// CreateAnalysisConsumer - Creates an ASTConsumer to run various code
50/// analysis passes. (The set of analyses run is controlled by command-line
51/// options.)
52std::unique_ptr<AnalysisASTConsumer>
54
55} // namespace ento
56
57} // end clang namespace
58
59#endif
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
ASTConsumer()=default
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
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...
virtual void AddDiagnosticConsumer(std::unique_ptr< PathDiagnosticConsumer > Consumer)=0
Manages a set of available checkers for running a static analysis.
std::unique_ptr< AnalysisASTConsumer > CreateAnalysisConsumer(CompilerInstance &CI)
CreateAnalysisConsumer - Creates an ASTConsumer to run various code analysis passes.
The JSON file list parser is used to communicate input to InstallAPI.
int const char * function
Definition c++config.h:31