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/ValueState.cpp | |
parent | 652adc6c5de6476d63791cec3e1166ee039e09b6 (diff) |
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/ValueState.cpp')
-rw-r--r-- | lib/Analysis/ValueState.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/Analysis/ValueState.cpp b/lib/Analysis/ValueState.cpp index ed6a86075b..94c62281aa 100644 --- a/lib/Analysis/ValueState.cpp +++ b/lib/Analysis/ValueState.cpp @@ -129,14 +129,22 @@ ValueStateManager::RemoveDeadBindings(ValueState* St, Stmt* Loc, } // Remove dead variable bindings. + + DeadSymbols.clear(); + for (ValueState::vb_iterator I = St->vb_begin(), E = St->vb_end(); I!=E ; ++I) - if (!Marked.count(I.getKey())) + if (!Marked.count(I.getKey())) { NewSt.VarBindings = Remove(NewSt, I.getKey()); + + RVal X = I.getData(); + + for (RVal::symbol_iterator SI = X.symbol_begin(), SE = X.symbol_end(); + SI != SE; ++SI) + if (!MarkedSymbols.count(*SI)) DeadSymbols.insert(*SI); + } // Remove dead symbols. - - DeadSymbols.clear(); - + for (ValueState::ce_iterator I = St->ce_begin(), E=St->ce_end(); I!=E; ++I) { SymbolID sym = I.getKey(); |