1 //===--- AnalysisConsumer.h - Front-end Analysis Engine Hooks ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header contains the functions necessary for a front-end to run various
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_STATICANALYZER_FRONTEND_ANALYSISCONSUMER_H
16 #define LLVM_CLANG_STATICANALYZER_FRONTEND_ANALYSISCONSUMER_H
18 #include "clang/AST/ASTConsumer.h"
19 #include "clang/Basic/LLVM.h"
26 class DiagnosticsEngine;
28 class CompilerInstance;
31 class PathDiagnosticConsumer;
33 class CheckerRegistry;
35 class AnalysisASTConsumer : public ASTConsumer {
37 virtual void AddDiagnosticConsumer(PathDiagnosticConsumer *Consumer) = 0;
39 /// This method allows registering statically linked custom checkers that are
40 /// not a part of the Clang tree. It employs the same mechanism that is used
45 /// Consumer->AddCheckerRegistrationFn([] (CheckerRegistry& Registry) {
46 /// Registry.addChecker<MyCustomChecker>("example.MyCustomChecker",
50 AddCheckerRegistrationFn(std::function<void(CheckerRegistry &)> Fn) = 0;
53 /// CreateAnalysisConsumer - Creates an ASTConsumer to run various code
54 /// analysis passes. (The set of analyses run is controlled by command-line
56 std::unique_ptr<AnalysisASTConsumer>
57 CreateAnalysisConsumer(CompilerInstance &CI);
61 } // end clang namespace