diff options
| author | Ted Kremenek <kremenek@apple.com> | 2008-04-25 01:25:15 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2008-04-25 01:25:15 +0000 |
| commit | 910e999c19dfcad3ae2a649e08e616525cef0af3 (patch) | |
| tree | 528114f2ad4f4d6e414034532a0964d6ebb523cc /lib/Analysis/CFRefCount.cpp | |
| parent | 652adc6c5de6476d63791cec3e1166ee039e09b6 (diff) | |
| download | clang-910e999c19dfcad3ae2a649e08e616525cef0af3.tar.gz clang-910e999c19dfcad3ae2a649e08e616525cef0af3.tar.bz2 clang-910e999c19dfcad3ae2a649e08e616525cef0af3.tar.xz | |
Do a better job at computing dead symbols.
Implemented support for better localized leaks in the CF reference count checker.
Now leaks should be flagged close to where they occur.
This should implement the desired functionality in <rdar://problem/5879592>, although the diagnostics still need to be improved.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
| -rw-r--r-- | lib/Analysis/CFRefCount.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index a1380af497..ad72d27a82 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -687,10 +687,10 @@ public: virtual void EvalDeadSymbols(ExplodedNodeSet<ValueState>& Dst, GRExprEngine& Engine, GRStmtNodeBuilder<ValueState>& Builder, - ProgramPoint P, ExplodedNode<ValueState>* Pred, + ExplodedNode<ValueState>* Pred, + Stmt* S, ValueState* St, const ValueStateManager::DeadSymbolsTy& Dead); - // Return statements. virtual void EvalReturn(ExplodedNodeSet<ValueState>& Dst, @@ -1096,21 +1096,11 @@ void CFRefCount::EvalEndPath(GRExprEngine& Eng, void CFRefCount::EvalDeadSymbols(ExplodedNodeSet<ValueState>& Dst, GRExprEngine& Eng, GRStmtNodeBuilder<ValueState>& Builder, - ProgramPoint P, ExplodedNode<ValueState>* Pred, + ExplodedNode<ValueState>* Pred, + Stmt* S, ValueState* St, const ValueStateManager::DeadSymbolsTy& Dead) { - - // FIXME: Have GRStmtNodeBuilder handle the case where 'P' is not PostStmt; - // This won't result in missed leaks; we'll just flag these ones at the - // end-of-path. - - Stmt* S = NULL; - - if (!isa<PostStmt>(P)) - return; - - S = cast<PostStmt>(P).getStmt(); - + // FIXME: a lot of copy-and-paste from EvalEndPath. Refactor. RefBindings B = GetRefBindings(*St); |
