diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-01-11 16:53:44 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-01-11 16:53:44 +0000 |
commit | b6a2b08a6b3fbce1a6a4b69d4185165de970696c (patch) | |
tree | 5655760a47b93dea0a795cf75a02f7ac8451813b | |
parent | 2e996d929d2593e5131640e774d04fe433ba5f89 (diff) |
Remove ProgramPoint parameter from GenericNodeBuilder::generateNode().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123240 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Analysis/ProgramPoint.h | 6 | ||||
-rw-r--r-- | include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h | 11 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Checkers/ExprEngine.cpp | 4 |
3 files changed, 13 insertions, 8 deletions
diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h index 36e40164c0..9656803b63 100644 --- a/include/clang/Analysis/ProgramPoint.h +++ b/include/clang/Analysis/ProgramPoint.h @@ -119,6 +119,12 @@ public: return B->empty() ? CFGElement() : B->front(); } + /// Create a new BlockEntrance object that is the same as the original + /// except for using the specified tag value. + BlockEntrance withTag(const void *tag) { + return BlockEntrance(getBlock(), getLocationContext(), tag); + } + static bool classof(const ProgramPoint* Location) { return Location->getKind() == BlockEntranceKind; } diff --git a/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h b/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h index 44a321c2f7..bc920d5cb1 100644 --- a/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h +++ b/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h @@ -428,18 +428,19 @@ public: } }; -template <typename PP> +template <typename PP_T> class GenericNodeBuilder : public GenericNodeBuilderImpl { public: - GenericNodeBuilder(CoreEngine &eng, ExplodedNode *pr, const PP &p) + GenericNodeBuilder(CoreEngine &eng, ExplodedNode *pr, const PP_T &p) : GenericNodeBuilderImpl(eng, pr, p) {} ExplodedNode *generateNode(const GRState *state, ExplodedNode *pred, - PP programPoint, bool asSink) { - return generateNodeImpl(state, pred, programPoint, asSink); + const void *tag, bool asSink) { + return generateNodeImpl(state, pred, cast<PP_T>(pp).withTag(tag), + asSink); } - const PP &getProgramPoint() const { return cast<PP>(pp); } + const PP_T &getProgramPoint() const { return cast<PP_T>(pp); } }; class EndOfFunctionNodeBuilder { diff --git a/lib/StaticAnalyzer/Checkers/ExprEngine.cpp b/lib/StaticAnalyzer/Checkers/ExprEngine.cpp index e6d9d715d4..3f9eb1b451 100644 --- a/lib/StaticAnalyzer/Checkers/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Checkers/ExprEngine.cpp @@ -1089,9 +1089,7 @@ void ExprEngine::processCFGBlockEntrance(ExplodedNodeSet &dstNodes, 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); + nodeBuilder.generateNode(pred->getState(), pred, &tag, true); } } |