diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/StaticAnalyzer/Core/BugReporter.cpp | 3 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Core/ExplodedGraph.cpp | 19 |
2 files changed, 3 insertions, 19 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index ab80d9e8ac..8f8eb3bb85 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1936,8 +1936,7 @@ TrimmedGraph::TrimmedGraph(const ExplodedGraph *OriginalGraph, // The trimmed graph is created in the body of the constructor to ensure // that the DenseMaps have been initialized already. InterExplodedGraphMap ForwardMap; - G.reset(OriginalGraph->trim(Nodes, /*BreakCycles=*/false, - &ForwardMap, &InverseMap)); + G.reset(OriginalGraph->trim(Nodes, &ForwardMap, &InverseMap)); // Find the (first) error node in the trimmed graph. We just need to consult // the node map which maps from nodes in the original graph to nodes 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; } |