clang 8.0.0

FrontendActions.h
Go to the documentation of this file.
1 //===-- FrontendActions.h - Useful Frontend Actions -------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_CLANG_STATICANALYZER_FRONTEND_FRONTENDACTIONS_H
11 #define LLVM_CLANG_STATICANALYZER_FRONTEND_FRONTENDACTIONS_H
12
13 #include "clang/Frontend/FrontendAction.h"
14 #include "llvm/ADT/StringMap.h"
15 #include "llvm/ADT/StringRef.h"
16
17 namespace clang {
18
19 class Stmt;
20 class AnalyzerOptions;
21
22 namespace ento {
23
24 //===----------------------------------------------------------------------===//
25 // AST Consumer Actions
26 //===----------------------------------------------------------------------===//
27
28 class AnalysisAction : public ASTFrontendAction {
29 protected:
30 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
31 StringRef InFile) override;
32 };
33
34 /// Frontend action to parse model files.
35 ///
36 /// This frontend action is responsible for parsing model files. Model files can
37 /// not be parsed on their own, they rely on type information that is available
38 /// in another translation unit. The parsing of model files is done by a
39 /// separate compiler instance that reuses the ASTContext and othen information
40 /// from the main translation unit that is being compiled. After a model file is
41 /// parsed, the function definitions will be collected into a StringMap.
42 class ParseModelFileAction : public ASTFrontendAction {
43 public:
44 ParseModelFileAction(llvm::StringMap<Stmt *> &Bodies);
45 bool isModelParsingAction() const override { return true; }
46
47 protected:
48 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
49 StringRef InFile) override;
50
51 private:
52 llvm::StringMap<Stmt *> &Bodies;
53 };
54
55 void printCheckerHelp(raw_ostream &OS, ArrayRef<std::string> plugins,
56 DiagnosticsEngine &diags);
57 void printEnabledCheckerList(raw_ostream &OS, ArrayRef<std::string> plugins,
58 const AnalyzerOptions &opts,
59 DiagnosticsEngine &diags);
60 void printAnalyzerConfigList(raw_ostream &OS);
61
62 } // end GR namespace
63
64 } // end namespace clang
65
66 #endif
ento
clang::ento::printAnalyzerConfigList
void printAnalyzerConfigList(raw_ostream &OS)
Definition: CheckerRegistration.cpp:66
clang::ento::AnalysisAction::CreateASTConsumer
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
Definition: FrontendActions.cpp:17
clang::ento::ParseModelFileAction::isModelParsingAction
bool isModelParsingAction() const override
Is this action invoked on a model file?
Definition: FrontendActions.h:45
clang::ento::printCheckerHelp
void printCheckerHelp(raw_ostream &OS, ArrayRef< std::string > plugins, DiagnosticsEngine &diags)
Definition: CheckerRegistration.cpp:49
clang::ento::AnalysisAction
Definition: FrontendActions.h:28
clang::DiagnosticsEngine
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:149
llvm::ArrayRef
Definition: LLVM.h:32
clang::ento::ParseModelFileAction
Frontend action to parse model files.
Definition: FrontendActions.h:42
clang::ento::printEnabledCheckerList
void printEnabledCheckerList(raw_ostream &OS, ArrayRef< std::string > plugins, const AnalyzerOptions &opts, DiagnosticsEngine &diags)
Definition: CheckerRegistration.cpp:57
clang::CompilerInstance
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Definition: CompilerInstance.h:73
clang::ASTFrontendAction
Abstract base class to use for AST consumer-based frontend actions.
Definition: FrontendAction.h:243
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::ento::ObjKind::OS
Indicates that the tracking object is a descendant of a referenced-counted OSObject, used in the Darwin kernel.
clang::AnalyzerOptions
Stores options for the analyzer from the command line.
Definition: AnalyzerOptions.h:163
FrontendAction.h
Defines the clang::FrontendAction interface and various convenience abstract classes (clang::ASTFront...