diff options
author | Anna Zaks <ganna@apple.com> | 2011-10-18 23:06:44 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-10-18 23:06:44 +0000 |
commit | a99b41f37fbdba04275136c511342cb3c7f22792 (patch) | |
tree | 453023879a39921301e090655272284b945eaad2 /clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp | |
parent | 1dd965eaa56958973abbbfea92c8d2743966200b (diff) | |
download | bcm5719-llvm-a99b41f37fbdba04275136c511342cb3c7f22792.tar.gz bcm5719-llvm-a99b41f37fbdba04275136c511342cb3c7f22792.zip |
[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).
llvm-svn: 142453
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp index 451fa91b3ab..d030469459f 100644 --- a/clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp +++ b/clang/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( |