diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-01-11 06:37:47 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-01-11 06:37:47 +0000 |
commit | 27c54e57c4a012dcdf2b40cf985b70d0b9caa69e (patch) | |
tree | b2653d0bbdcbe929477a48322d975e79c97028e4 /lib/StaticAnalyzer/Checkers/ExprEngine.cpp | |
parent | 7771406ac3c58d77468d9d176262ad7ae7ff5050 (diff) |
Rework ExprEngine::processCFGBlockEntrance()
to use a node builder. This paves the way
for Checkers to interpose (via a "visit" method)
at the entrance to blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123217 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/ExprEngine.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/ExprEngine.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Checkers/ExprEngine.cpp b/lib/StaticAnalyzer/Checkers/ExprEngine.cpp index 5dd5d72a4c..e6d9d715d4 100644 --- a/lib/StaticAnalyzer/Checkers/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Checkers/ExprEngine.cpp @@ -1077,11 +1077,22 @@ void ExprEngine::Visit(const Stmt* S, ExplodedNode* Pred, // Block entrance. (Update counters). //===----------------------------------------------------------------------===// -bool ExprEngine::processCFGBlockEntrance(const CFGBlock* B, - const ExplodedNode *Pred, - BlockCounter BC) { - return BC.getNumVisited(Pred->getLocationContext()->getCurrentStackFrame(), - B->getBlockID()) < AMgr.getMaxVisit(); +void ExprEngine::processCFGBlockEntrance(ExplodedNodeSet &dstNodes, + GenericNodeBuilder<BlockEntrance> &nodeBuilder){ + + // FIXME: Refactor this into a checker. + const CFGBlock *block = nodeBuilder.getProgramPoint().getBlock(); + ExplodedNode *pred = nodeBuilder.getPredecessor(); + + if (nodeBuilder.getBlockCounter().getNumVisited( + pred->getLocationContext()->getCurrentStackFrame(), + block->getBlockID()) >= AMgr.getMaxVisit()) { + + static int tag = 0; + const BlockEntrance &BE = nodeBuilder.getProgramPoint(); + BlockEntrance BE_tagged(BE.getBlock(), BE.getLocationContext(), &tag); + nodeBuilder.generateNode(pred->getState(), pred, BE_tagged, true); + } } //===----------------------------------------------------------------------===// |