diff options
author | Anna Zaks <ganna@apple.com> | 2011-10-25 19:56:48 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-10-25 19:56:48 +0000 |
commit | af498a28797c075c48d7e943df5f5a8e78ed8eb0 (patch) | |
tree | 49186d578c20198b3b26cad2a5a743e037db8aa0 /lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | |
parent | 7fe3878a36750515fb9772414ecb2489cf149d19 (diff) |
[analyze] Convert EndOfPath callback to use CheckerContext
Get rid of the EndOfPathBuilder completely.
Use the generic NodeBuilder to generate nodes.
Enqueue the end of path frontier explicitly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index fcf0af9ba4..c7d108b2f7 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -47,24 +47,13 @@ class GenericNodeBuilderRefCount { EndOfFunctionNodeBuilder *ENB; public: GenericNodeBuilderRefCount(CheckerContext &c, - const ProgramPointTag *t) + const ProgramPointTag *t = 0) : C(&c), tag(t), ENB(0) {} - GenericNodeBuilderRefCount(EndOfFunctionNodeBuilder &enb) - : C(0), tag(0), ENB(&enb) {} - ExplodedNode *MakeNode(const ProgramState *state, ExplodedNode *Pred, bool MarkAsSink = false) { - if (C) { - return C->generateNode(state, Pred, tag, false, MarkAsSink); - } - - assert(ENB); - ExplodedNode *N = ENB->generateNode(state, Pred); - if (MarkAsSink) - N->markAsSink(); - - return N; + assert(C); + return C->generateNode(state, Pred, tag, false, MarkAsSink); } }; } // end anonymous namespace @@ -2445,7 +2434,7 @@ public: SymbolRef Sym, const ProgramState *state) const; void checkDeadSymbols(SymbolReaper &SymReaper, CheckerContext &C) const; - void checkEndPath(EndOfFunctionNodeBuilder &Builder, ExprEngine &Eng) const; + void checkEndPath(CheckerContext &C) const; const ProgramState *updateSymbol(const ProgramState *state, SymbolRef sym, RefVal V, ArgEffect E, RefVal::Kind &hasErr, @@ -3439,12 +3428,12 @@ RetainCountChecker::processLeaks(const ProgramState *state, return N; } -void RetainCountChecker::checkEndPath(EndOfFunctionNodeBuilder &Builder, - ExprEngine &Eng) const { - const ProgramState *state = Builder.getState(); - GenericNodeBuilderRefCount Bd(Builder); +void RetainCountChecker::checkEndPath(CheckerContext &Ctx) const { + const ProgramState *state = Ctx.getState(); + GenericNodeBuilderRefCount Bd(Ctx); RefBindings B = state->get<RefBindings>(); - ExplodedNode *Pred = Builder.getPredecessor(); + ExplodedNode *Pred = Ctx.getPredecessor(); + ExprEngine &Eng = Ctx.getEngine(); for (RefBindings::iterator I = B.begin(), E = B.end(); I != E; ++I) { llvm::tie(Pred, state) = handleAutoreleaseCounts(state, Bd, Pred, Eng, |