Make AnalysisManager stateless. Now other analyzer components only depends on
local node information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81433 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index 23ca53d..c15161c 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -36,14 +36,6 @@
if ((*I)->isOwnedByReporterContext()) delete *I;
}
-const Decl& BugReporterContext::getCodeDecl() {
- return *BR.getEngine().getAnalysisManager().getCodeDecl();
-}
-
-const CFG& BugReporterContext::getCFG() {
- return *BR.getEngine().getAnalysisManager().getCFG();
-}
-
//===----------------------------------------------------------------------===//
// Helper routines for walking the ExplodedGraph and fetching statements.
//===----------------------------------------------------------------------===//
@@ -158,11 +150,9 @@
PathDiagnosticLocation ExecutionContinues(llvm::raw_string_ostream& os,
const ExplodedNode* N);
- ParentMap& getParentMap() {
- if (PM.get() == 0)
- PM.reset(new ParentMap(getCodeDecl().getBody()));
- return *PM.get();
- }
+ Decl const &getCodeDecl() { return R->getEndNode()->getCodeDecl(); }
+
+ ParentMap& getParentMap() { return R->getEndNode()->getParentMap(); }
const Stmt *getParent(const Stmt *S) {
return getParentMap().getParent(S);