summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/Analysis/AnalysisDeclContext.h2
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h28
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h3
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h1
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h2
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h6
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h4
7 files changed, 28 insertions, 18 deletions
diff --git a/include/clang/Analysis/AnalysisDeclContext.h b/include/clang/Analysis/AnalysisDeclContext.h
index d5445d3ce5..9faa78cde8 100644
--- a/include/clang/Analysis/AnalysisDeclContext.h
+++ b/include/clang/Analysis/AnalysisDeclContext.h
@@ -257,7 +257,7 @@ public:
return getAnalysisDeclContext()->getAnalysis<T>();
}
- ParentMap &getParentMap() const {
+ const ParentMap &getParentMap() const {
return getAnalysisDeclContext()->getParentMap();
}
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
index 9a16f23461..f73fd29805 100644
--- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
+++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
@@ -217,10 +217,10 @@ public:
void markInteresting(SVal V);
void markInteresting(const LocationContext *LC);
- bool isInteresting(SymbolRef sym);
- bool isInteresting(const MemRegion *R);
- bool isInteresting(SVal V);
- bool isInteresting(const LocationContext *LC);
+ bool isInteresting(SymbolRef sym) const;
+ bool isInteresting(const MemRegion *R) const;
+ bool isInteresting(SVal V) const;
+ bool isInteresting(const LocationContext *LC) const;
/// Returns whether or not this report should be considered valid.
///
@@ -469,9 +469,9 @@ public:
ASTContext &getContext() { return D.getASTContext(); }
- SourceManager &getSourceManager() { return D.getSourceManager(); }
+ const SourceManager &getSourceManager() { return D.getSourceManager(); }
- AnalyzerOptions &getAnalyzerOptions() { return D.getAnalyzerOptions(); }
+ const AnalyzerOptions &getAnalyzerOptions() { return D.getAnalyzerOptions(); }
virtual std::unique_ptr<DiagnosticForConsumerMapTy>
generatePathDiagnostics(ArrayRef<PathDiagnosticConsumer *> consumers,
@@ -519,12 +519,14 @@ public:
/// getGraph - Get the exploded graph created by the analysis engine
/// for the analyzed method or function.
- ExplodedGraph &getGraph();
+ const ExplodedGraph &getGraph() const;
/// getStateManager - Return the state manager used by the analysis
/// engine.
ProgramStateManager &getStateManager();
+ ProgramStateManager &getStateManager() const;
+
/// \p bugReports A set of bug reports within a *single* equivalence class
///
/// \return A mapping from consumers to the corresponding diagnostics.
@@ -566,25 +568,25 @@ public:
GRBugReporter& getBugReporter() { return BR; }
- ExplodedGraph &getGraph() { return BR.getGraph(); }
+ const ExplodedGraph &getGraph() const { return BR.getGraph(); }
- ProgramStateManager& getStateManager() {
+ ProgramStateManager& getStateManager() const {
return BR.getStateManager();
}
- SValBuilder &getSValBuilder() {
+ SValBuilder &getSValBuilder() const {
return getStateManager().getSValBuilder();
}
- ASTContext &getASTContext() {
+ ASTContext &getASTContext() const {
return BR.getContext();
}
- SourceManager& getSourceManager() {
+ const SourceManager& getSourceManager() const {
return BR.getSourceManager();
}
- AnalyzerOptions &getAnalyzerOptions() {
+ const AnalyzerOptions &getAnalyzerOptions() const {
return BR.getAnalyzerOptions();
}
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
index ecd5ed0ca3..0e2346174a 100644
--- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
+++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
@@ -74,7 +74,8 @@ public:
/// NOTE that this function can be implemented on at most one used visitor,
/// and otherwise it crahes at runtime.
virtual PathDiagnosticPieceRef
- getEndPath(BugReporterContext &BRC, const ExplodedNode *N, BugReport &BR);
+ getEndPath(BugReporterContext &BRC, const ExplodedNode *N,
+ BugReport &BR);
virtual void Profile(llvm::FoldingSetNodeID &ID) const = 0;
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
index f982595600..7ccf569a68 100644
--- a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
+++ b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
@@ -919,7 +919,6 @@ public:
};
} // namespace ento
-
} // namespace clang
#endif // LLVM_CLANG_STATICANALYZER_CORE_BUGREPORTER_PATHDIAGNOSTIC_H
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
index 981133e669..1d2e554ec2 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
@@ -103,7 +103,7 @@ public:
return Eng.getBugReporter();
}
- SourceManager &getSourceManager() {
+ const SourceManager &getSourceManager() {
return getBugReporter().getSourceManager();
}
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
index 52ae92e70d..864266e77e 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
@@ -153,7 +153,11 @@ public:
CFG &getCFG() const { return *getLocationContext()->getCFG(); }
- ParentMap &getParentMap() const {return getLocationContext()->getParentMap();}
+ const CFGBlock *getCFGBlock() const;
+
+ const ParentMap &getParentMap() const {
+ return getLocationContext()->getParentMap();
+ }
template <typename T>
T &getAnalysis() const {
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
index d38058f9af..07920790c8 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
@@ -507,6 +507,10 @@ public:
return *svalBuilder;
}
+ const SValBuilder &getSValBuilder() const {
+ return *svalBuilder;
+ }
+
SymbolManager &getSymbolManager() {
return svalBuilder->getSymbolManager();
}