diff options
| author | Jordan Rose <jordan_rose@apple.com> | 2012-07-26 20:04:08 +0000 |
|---|---|---|
| committer | Jordan Rose <jordan_rose@apple.com> | 2012-07-26 20:04:08 +0000 |
| commit | b3244566f002bba9fb5149d85eee26017e04bbf1 (patch) | |
| tree | 448c316fd46bc8675245b7cfe01723efc5dada0a /clang/lib | |
| parent | a4c0d21f4285c69bbe4a5ab53af49350d40446d5 (diff) | |
| download | bcm5719-llvm-b3244566f002bba9fb5149d85eee26017e04bbf1.tar.gz bcm5719-llvm-b3244566f002bba9fb5149d85eee26017e04bbf1.zip | |
[analyzer] Variables with destructors are live until the destructor is run.
Test case in the next commit, which enables destructors under certain
circumstances.
llvm-svn: 160805
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Analysis/LiveVariables.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index 6e10ac10927..584d81284e9 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/lib/Analysis/LiveVariables.cpp @@ -455,6 +455,12 @@ LiveVariablesImpl::runOnBlock(const CFGBlock *block, for (CFGBlock::const_reverse_iterator it = block->rbegin(), ei = block->rend(); it != ei; ++it) { const CFGElement &elem = *it; + + if (const CFGAutomaticObjDtor *Dtor = dyn_cast<CFGAutomaticObjDtor>(&elem)){ + val.liveDecls = DSetFact.add(val.liveDecls, Dtor->getVarDecl()); + continue; + } + if (!isa<CFGStmt>(elem)) continue; |

