clang: include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_ANALYSISMANAGER_H
15#define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_ANALYSISMANAGER_H
16
23
25
27
28namespace ento {
30
32 virtual void anchor();
34
39
40
43
45
46public:
48
54 std::unique_ptr injector = nullptr);
55
57
59 AnaCtxMgr.clear();
60 }
61
63 return AnaCtxMgr;
64 }
65
67
69 return CreateStoreMgr;
70 }
71
75
77 return CreateConstraintMgr;
78 }
79
81
85
89
93
96 return PathConsumers;
97 }
98
100
102 return options.visualizeExplodedGraphWithGraphViz;
103 }
104
108
110 return AnaCtxMgr.getContext(D)->getCFG();
111 }
112
113 template
115 return AnaCtxMgr.getContext(D)->getAnalysis<T>();
116 }
117
119 return AnaCtxMgr.getContext(D)->getParentMap();
120 }
121
123 return AnaCtxMgr.getContext(D);
124 }
125
127 if (SM.isInMainFile(SL))
128 return true;
129
130
131
132
133
135 if (!IL.isValid() || .isInMainFile(IL))
136 return false;
137
138
139 if (SM.getFilename(IL).contains("UnifiedSource")) {
140
141
142 return llvm::StringSwitch(SM.getFilename(SL).rsplit('.').second)
143 .Cases({"c", "m", "mm", "C", "cc", "cp"}, true)
144 .Cases({"cpp", "CPP", "c++", "cxx", "cppm"}, true)
146 }
147
148 return false;
149 }
150
155};
156
157}
158
159}
160
161#endif
This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...
Defines the clang::Preprocessor interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceManager & getSourceManager()
AnalysisDeclContext contains the context data for the function, method or block under analysis.
Stores options for the analyzer from the command line.
Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt.
CodeInjector is an interface which is responsible for injecting AST of function definitions that may ...
Decl - This represents one declaration (or definition), e.g.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
This class handles loading and caching of source files into memory.
const LangOptions & getLangOpts() const
Definition AnalysisManager.h:90
ConstraintManagerCreator getConstraintManagerCreator()
Definition AnalysisManager.h:76
ASTContext & getASTContext() override
Definition AnalysisManager.h:82
void ClearContexts()
Definition AnalysisManager.h:58
Preprocessor & getPreprocessor() override
Definition AnalysisManager.h:66
static bool isInCodeFile(SourceLocation SL, const SourceManager &SM)
Definition AnalysisManager.h:126
bool isInCodeFile(SourceLocation SL)
Definition AnalysisManager.h:151
AnalysisDeclContext * getAnalysisDeclContext(const Decl *D)
Definition AnalysisManager.h:122
AnalysisDeclContextManager & getAnalysisDeclContextManager()
Definition AnalysisManager.h:62
SourceManager & getSourceManager() override
Definition AnalysisManager.h:86
T * getAnalysis(Decl const *D)
Definition AnalysisManager.h:114
bool shouldVisualize() const
Definition AnalysisManager.h:101
ArrayRef< std::unique_ptr< PathDiagnosticConsumer > > getPathDiagnosticConsumers() override
Definition AnalysisManager.h:95
StoreManagerCreator getStoreManagerCreator()
Definition AnalysisManager.h:68
AnalyzerOptions & options
Definition AnalysisManager.h:47
~AnalysisManager() override
ParentMap & getParentMap(Decl const *D)
Definition AnalysisManager.h:118
bool shouldInlineCall() const
Definition AnalysisManager.h:105
CheckerManager * getCheckerManager() const
Definition AnalysisManager.h:80
CFG * getCFG(Decl const *D)
Definition AnalysisManager.h:109
AnalyzerOptions & getAnalyzerOptions() override
Definition AnalysisManager.h:72
AnalysisManager(ASTContext &ctx, Preprocessor &PP, PathDiagnosticConsumers Consumers, StoreManagerCreator storemgr, ConstraintManagerCreator constraintmgr, CheckerManager *checkerMgr, AnalyzerOptions &Options, std::unique_ptr< CodeInjector > injector=nullptr)
std::unique_ptr< ConstraintManager >(* ConstraintManagerCreator)(ProgramStateManager &, ExprEngine *)
std::unique_ptr< StoreManager >(* StoreManagerCreator)(ProgramStateManager &)
std::vector< std::unique_ptr< PathDiagnosticConsumer > > PathDiagnosticConsumers
The JSON file list parser is used to communicate input to InstallAPI.
@ IPAK_None
Perform only intra-procedural analysis.
const FunctionProtoType * T