diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-03-22 21:15:33 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-03-22 21:15:33 +0000 |
commit | 0f3a34fb7fea37ebfbcba8b400ccb697b9559b49 (patch) | |
tree | 8be62a235533b3ac7d725f5801694d9bdd65fcaf /lib/StaticAnalyzer/Core/ExplodedGraph.cpp | |
parent | 228094a28f81ddba94427239dea5c6e59ff6aabc (diff) |
Revert "[analyzer] Break cycles (optionally) when trimming an ExplodedGraph."
The algorithm used here was ridiculously slow when a potential back-edge
pointed to a node that already had a lot of successors. The previous commit
makes this feature unnecessary anyway.
This reverts r177468 / f4cf6b10f863b9bc716a09b2b2a8c497dcc6aa9b.
Conflicts:
lib/StaticAnalyzer/Core/BugReporter.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExplodedGraph.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExplodedGraph.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp index f9d4345bae..ca466d8907 100644 --- a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp +++ b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp @@ -331,22 +331,8 @@ ExplodedNode *ExplodedGraph::getNode(const ProgramPoint &L, return V; } -static bool isDescendent(const ExplodedNode *Parent, const ExplodedNode *Child){ - SmallVector<const ExplodedNode *, 16> WL; - WL.push_back(Parent); - - while (!WL.empty()) { - const ExplodedNode *N = WL.pop_back_val(); - if (N == Child) - return true; - WL.append(N->succ_begin(), N->succ_end()); - } - - return false; -} - ExplodedGraph * -ExplodedGraph::trim(ArrayRef<const NodeTy *> Sinks, bool BreakCycles, +ExplodedGraph::trim(ArrayRef<const NodeTy *> Sinks, InterExplodedGraphMap *ForwardMap, InterExplodedGraphMap *InverseMap) const{ @@ -443,8 +429,7 @@ ExplodedGraph::trim(ArrayRef<const NodeTy *> Sinks, bool BreakCycles, I != E; ++I) { Pass2Ty::iterator PI = Pass2.find(*I); if (PI != Pass2.end()) { - if (!BreakCycles || !isDescendent(PI->second, NewN)) - const_cast<ExplodedNode *>(PI->second)->addPredecessor(NewN, *G); + const_cast<ExplodedNode *>(PI->second)->addPredecessor(NewN, *G); continue; } |