diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-12-04 06:57:49 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-12-04 06:57:49 +0000 |
commit | 6e8541ddd024077e4491ef2a49251719fdae76fa (patch) | |
tree | b849af88a469740a2e99bc20867519321f28a089 | |
parent | f1e2c829d502d6772e60d31dd9d705cd33805587 (diff) | |
download | bcm5719-llvm-6e8541ddd024077e4491ef2a49251719fdae76fa.tar.gz bcm5719-llvm-6e8541ddd024077e4491ef2a49251719fdae76fa.zip |
Rename instance variable to avoid name conflict with parameters, and modify addTransition() to compare the correct state values.
llvm-svn: 90552
-rw-r--r-- | clang/include/clang/Analysis/PathSensitive/Checker.h | 9 | ||||
-rw-r--r-- | clang/lib/Analysis/Checker.cpp | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/Checker.h b/clang/include/clang/Analysis/PathSensitive/Checker.h index b380f1bf02f..afe563cd8ce 100644 --- a/clang/include/clang/Analysis/PathSensitive/Checker.h +++ b/clang/include/clang/Analysis/PathSensitive/Checker.h @@ -39,7 +39,7 @@ class CheckerContext { 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 @@ public: 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 @@ public: 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 @@ public: 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); diff --git a/clang/lib/Analysis/Checker.cpp b/clang/lib/Analysis/Checker.cpp index 0d907e50168..fb9d04d947b 100644 --- a/clang/lib/Analysis/Checker.cpp +++ b/clang/lib/Analysis/Checker.cpp @@ -24,10 +24,10 @@ CheckerContext::~CheckerContext() { // 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); |