aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-02-14 18:05:07 +0000
committerTed Kremenek <kremenek@apple.com>2011-02-14 18:05:07 +0000
commit6a6d9a8eceb9424b18ed4a897dece97e5bf5c297 (patch)
tree1db3c1bc45bddab91cca7e484be5456dfe1dd073 /lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
parente8350c6996170e324b31cd188d002fe5f40f54f7 (diff)
Remove dead code in IdempotentOperationChecker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp b/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
index 0b8ebfd285..8f47f9eb4f 100644
--- a/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
@@ -91,9 +91,6 @@ private:
static bool isConstantOrPseudoConstant(const DeclRefExpr *DR,
AnalysisContext *AC);
static bool containsNonLocalVarDecl(const Stmt *S);
- void getLastRelevantNodes(const CFGBlock *Begin,
- const ExplodedNode *N,
- ExplodedNodeSet &result);
// Hash table and related data structures
struct BinaryOperatorData {
@@ -762,49 +759,6 @@ bool IdempotentOperationChecker::containsNonLocalVarDecl(const Stmt *S) {
return false;
}
-// Returns the successor nodes of N whose CFGBlocks cannot reach N's CFGBlock.
-// This effectively gives us a set of points in the ExplodedGraph where
-// subsequent execution could not affect the idempotent operation on this path.
-// This is useful for displaying paths after the point of the error, providing
-// an example of how this idempotent operation cannot change.
-void IdempotentOperationChecker::getLastRelevantNodes(
- const CFGBlock *Begin, const ExplodedNode *node,
- ExplodedNodeSet &result) {
- llvm::SmallVector<const ExplodedNode *, 11> worklist;
- llvm::DenseMap<const ExplodedNode *, unsigned> visited;
-
- worklist.push_back(node);
-
- while (!worklist.empty()) {
- node = worklist.back();
- worklist.pop_back();
-
- // Was this node previously visited?
- unsigned &visitFlag = visited[node];
- if (visitFlag)
- continue;
- visitFlag = 1;
-
- const ProgramPoint &PP = node->getLocation();
- if (const BlockEntrance *BE = dyn_cast<BlockEntrance>(&PP)) {
- // Get the CFGBlock and test the reachability
- const CFGBlock *CB = BE->getBlock();
-
- // If we cannot reach the beginning CFGBlock from this block, then we are
- // finished
- if (!CRA->isReachable(CB, Begin)) {
- result.Add(const_cast<ExplodedNode *>(node));
- continue;
- }
- }
-
- // Add unvisited children to the worklist
- for (ExplodedNode::const_succ_iterator i = node->succ_begin(),
- e = node->succ_end(); i != e; ++i)
- worklist.push_back(*i);
- }
-}
-
bool IdempotentOperationChecker::CFGReachabilityAnalysis::isReachable(
const CFGBlock *Src,
const CFGBlock *Dst) {