summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-01-11 16:53:44 +0000
committerTed Kremenek <kremenek@apple.com>2011-01-11 16:53:44 +0000
commit841df11dab60ee950173f478edf56075cf7d8c7e (patch)
tree7836658956e0ec2219cfd91735762a3ad64ba38b
parent5a384c86b278588647a26615b3ecfdb0c0b117fd (diff)
downloadbcm5719-llvm-841df11dab60ee950173f478edf56075cf7d8c7e.tar.gz
bcm5719-llvm-841df11dab60ee950173f478edf56075cf7d8c7e.zip
Remove ProgramPoint parameter from GenericNodeBuilder::generateNode().
llvm-svn: 123240
-rw-r--r--clang/include/clang/Analysis/ProgramPoint.h6
-rw-r--r--clang/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h11
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp4
3 files changed, 13 insertions, 8 deletions
diff --git a/clang/include/clang/Analysis/ProgramPoint.h b/clang/include/clang/Analysis/ProgramPoint.h
index 36e40164c0e..9656803b635 100644
--- a/clang/include/clang/Analysis/ProgramPoint.h
+++ b/clang/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/clang/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h b/clang/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h
index 44a321c2f73..bc920d5cb1a 100644
--- a/clang/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h
+++ b/clang/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/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
index e6d9d715d43..3f9eb1b451e 100644
--- a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
+++ b/clang/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);
}
}
OpenPOWER on IntegriCloud