aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-10-18 23:06:44 +0000
committerAnna Zaks <ganna@apple.com>2011-10-18 23:06:44 +0000
commit4e82d3cf6fd4c907265e3fa3aac0a835c35dc759 (patch)
treef997ce150d184ef26d497440adaaf6dbbbaa33c0 /lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp
parent3152b3cb5b6a2f797d0972c81a5eb3fd69c0d620 (diff)
[analyzer] Make NodeBuilder and Pred node loosely coupled
NodeBuilder should not assume it's dealing with a single predecessor. Remove predecessor getters. Modify the BranchNodeBuilder to not be responsible for doing auto-transitions (which depend on a predecessor). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp b/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp
index 451fa91b3a..d030469459 100644
--- a/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp
@@ -50,26 +50,26 @@ class UndefBranchChecker : public Checker<check::BranchCondition> {
public:
void checkBranchCondition(const Stmt *Condition, NodeBuilder &Builder,
- ExprEngine &Eng) const;
+ ExplodedNode *Pred, ExprEngine &Eng) const;
};
}
void UndefBranchChecker::checkBranchCondition(const Stmt *Condition,
NodeBuilder &Builder,
+ ExplodedNode *Pred,
ExprEngine &Eng) const {
- const ProgramState *state = Builder.getState();
+ const ProgramState *state = Pred->getState();
SVal X = state->getSVal(Condition);
if (X.isUndef()) {
// TODO: The PP will be generated with the correct tag by the CheckerManager
// after we migrate the callback to CheckerContext.
const ProgramPointTag *Tag = 0;
- ProgramPoint PP = PostCondition(Condition,
- Builder.getPredecessor()->getLocationContext(), Tag);
+ ProgramPoint PP = PostCondition(Condition, Pred->getLocationContext(), Tag);
// Generate a sink node, which implicitly marks both outgoing branches as
// infeasible.
ExplodedNode *N = Builder.generateNode(PP, state,
- Builder.getPredecessor(), true);
+ Pred, true);
if (N) {
if (!BT)
BT.reset(