clang 10.0.0git

FrontendActions.h
Go to the documentation of this file.
1 //===-- FrontendActions.h - Useful Frontend Actions -------------*- 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 #ifndef LLVM_CLANG_STATICANALYZER_FRONTEND_FRONTENDACTIONS_H
10 #define LLVM_CLANG_STATICANALYZER_FRONTEND_FRONTENDACTIONS_H
11
12 #include "clang/Frontend/FrontendAction.h"
13 #include "llvm/ADT/StringMap.h"
14 #include "llvm/ADT/StringRef.h"
15
16 namespace clang {
17
18 class Stmt;
19 class AnalyzerOptions;
20
21 namespace ento {
22
23 //===----------------------------------------------------------------------===//
24 // AST Consumer Actions
25 //===----------------------------------------------------------------------===//
26
27 class AnalysisAction : public ASTFrontendAction {
28 protected:
29 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
30 StringRef InFile) override;
31 };
32
33 /// Frontend action to parse model files.
34 ///
35 /// This frontend action is responsible for parsing model files. Model files can
36 /// not be parsed on their own, they rely on type information that is available
37 /// in another translation unit. The parsing of model files is done by a
38 /// separate compiler instance that reuses the ASTContext and othen information
39 /// from the main translation unit that is being compiled. After a model file is
40 /// parsed, the function definitions will be collected into a StringMap.
41 class ParseModelFileAction : public ASTFrontendAction {
42 public:
43 ParseModelFileAction(llvm::StringMap<Stmt *> &Bodies);
44 bool isModelParsingAction() const override { return true; }
45
46 protected:
47 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
48 StringRef InFile) override;
49
50 private:
51 llvm::StringMap<Stmt *> &Bodies;
52 };
53
54 void printCheckerHelp(raw_ostream &OS,
55 ArrayRef<std::string> plugins,
56 AnalyzerOptions &opts,
57 DiagnosticsEngine &diags,
58 const LangOptions &LangOpts);
59 void printEnabledCheckerList(raw_ostream &OS, ArrayRef<std::string> plugins,
60 AnalyzerOptions &opts,
61 DiagnosticsEngine &diags,
62 const LangOptions &LangOpts);
63 void printAnalyzerConfigList(raw_ostream &OS);
64 void printCheckerConfigList(raw_ostream &OS, ArrayRef<std::string> plugins,
65 AnalyzerOptions &opts,
66 DiagnosticsEngine &diags,
67 const LangOptions &LangOpts);
68
69 } // end GR namespace
70
71 } // end namespace clang
72
73 #endif
ento
clang::ento::printEnabledCheckerList
void printEnabledCheckerList(raw_ostream &OS, ArrayRef< std::string > plugins, AnalyzerOptions &opts, DiagnosticsEngine &diags, const LangOptions &LangOpts)
Definition: CheckerRegistration.cpp:56
clang::ento::printAnalyzerConfigList
void printAnalyzerConfigList(raw_ostream &OS)
Definition: CheckerRegistration.cpp:76
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:16
clang::ento::ParseModelFileAction::isModelParsingAction
bool isModelParsingAction() const override
Is this action invoked on a model file?
Definition: FrontendActions.h:44
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:53
clang::ento::AnalysisAction
Definition: FrontendActions.h:27
clang::ento::printCheckerHelp
void printCheckerHelp(raw_ostream &OS, ArrayRef< std::string > plugins, AnalyzerOptions &opts, DiagnosticsEngine &diags, const LangOptions &LangOpts)
Definition: CheckerRegistration.cpp:45
clang::DiagnosticsEngine
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:149
llvm::ArrayRef< std::string >
clang::ento::ParseModelFileAction
Frontend action to parse model files.
Definition: FrontendActions.h:41
clang::ento::printCheckerConfigList
void printCheckerConfigList(raw_ostream &OS, ArrayRef< std::string > plugins, AnalyzerOptions &opts, DiagnosticsEngine &diags, const LangOptions &LangOpts)
Definition: CheckerRegistration.cpp:67
clang::CompilerInstance
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Definition: CompilerInstance.h:72
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:21
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:162
FrontendAction.h
Defines the clang::FrontendAction interface and various convenience abstract classes (clang::ASTFront...