[cfe-commits] r123240 - in /cfe/trunk: include/clang/Analysis/ProgramPoint.h include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h lib/StaticAnalyzer/Checkers/ExprEngine.cpp
Ted Kremenek
kremenek at apple.com
Tue Jan 11 08:53:44 PST 2011
Author: kremenek
Date: Tue Jan 11 10:53:44 2011
New Revision: 123240
URL: http://llvm.org/viewvc/llvm-project?rev=123240&view=rev
Log:
Remove ProgramPoint parameter from GenericNodeBuilder::generateNode().
Modified:
cfe/trunk/include/clang/Analysis/ProgramPoint.h
cfe/trunk/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h
cfe/trunk/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
Modified: cfe/trunk/include/clang/Analysis/ProgramPoint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/ProgramPoint.h?rev=123240&r1=123239&r2=123240&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/ProgramPoint.h (original)
+++ cfe/trunk/include/clang/Analysis/ProgramPoint.h Tue Jan 11 10:53:44 2011
@@ -119,6 +119,12 @@
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;
}
Modified: cfe/trunk/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h?rev=123240&r1=123239&r2=123240&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h Tue Jan 11 10:53:44 2011
@@ -428,18 +428,19 @@
}
};
-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 {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ExprEngine.cpp?rev=123240&r1=123239&r2=123240&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ExprEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ExprEngine.cpp Tue Jan 11 10:53:44 2011
@@ -1089,9 +1089,7 @@
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);
}
}
More information about the cfe-commits
mailing list