[cfe-commits] r90552 - in /cfe/trunk: include/clang/Analysis/PathSensitive/Checker.h lib/Analysis/Checker.cpp
Ted Kremenek
kremenek at apple.com
Thu Dec 3 22:57:49 PST 2009
Author: kremenek
Date: Fri Dec 4 00:57:49 2009
New Revision: 90552
URL: http://llvm.org/viewvc/llvm-project?rev=90552&view=rev
Log:
Rename instance variable to avoid name conflict with parameters, and modify addTransition() to compare the correct state values.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/Checker.h
cfe/trunk/lib/Analysis/Checker.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/Checker.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/Checker.h?rev=90552&r1=90551&r2=90552&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/Checker.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/Checker.h Fri Dec 4 00:57:49 2009
@@ -39,7 +39,7 @@
SaveAndRestore<const void*> OldTag;
SaveAndRestore<ProgramPoint::Kind> OldPointKind;
SaveOr OldHasGen;
- const GRState *state;
+ const GRState *ST;
const Stmt *statement;
const unsigned size;
bool DoneEvaluating; // FIXME: This is not a permanent API change.
@@ -53,7 +53,7 @@
OldTag(B.Tag, tag),
OldPointKind(B.PointKind, K),
OldHasGen(B.HasGeneratedNode),
- state(st), statement(stmt), size(Dst.size()) {}
+ ST(st), statement(stmt), size(Dst.size()) {}
~CheckerContext();
@@ -68,7 +68,7 @@
ExplodedNodeSet &getNodeSet() { return Dst; }
GRStmtNodeBuilder &getNodeBuilder() { return B; }
ExplodedNode *&getPredecessor() { return Pred; }
- const GRState *getState() { return state ? state : B.GetState(Pred); }
+ const GRState *getState() { return ST ? ST : B.GetState(Pred); }
ASTContext &getASTContext() {
return Eng.getContext();
@@ -126,8 +126,7 @@
void addTransition(const GRState *state) {
assert(state);
- if (state != getState() ||
- (state && state != B.GetState(Pred)))
+ if (state != getState() || (ST && ST != B.GetState(Pred)))
GenerateNode(state, true);
else
Dst.Add(Pred);
Modified: cfe/trunk/lib/Analysis/Checker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Checker.cpp?rev=90552&r1=90551&r2=90552&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/Checker.cpp (original)
+++ cfe/trunk/lib/Analysis/Checker.cpp Fri Dec 4 00:57:49 2009
@@ -24,10 +24,10 @@
// if we are building sinks or we generated a node and decided to not
// add it as a transition.
if (Dst.size() == size && !B.BuildSinks && !B.HasGeneratedNode) {
- if (state && state != B.GetState(Pred)) {
+ if (ST && ST != B.GetState(Pred)) {
static int autoTransitionTag = 0;
B.Tag = &autoTransitionTag;
- addTransition(state);
+ addTransition(ST);
}
else
Dst.Add(Pred);
More information about the cfe-commits
mailing list