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 | d7f1d134a03ace51f8d142fbb7f436330704ede5 (patch) | |
tree | b2289cda6f0f9de92f492e8db44b9effb096b97b /lib/Analysis/LiveVariables.cpp | |
parent | 183ba8e19d49ab1ae25d3cdd0a19591369c5ab9f (diff) |
[analyzer] Variables with destructors are live until the destructor is run.
Test case in the next commit, which enables destructors under certain
circumstances.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160805 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | lib/Analysis/LiveVariables.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 6e10ac1092..584d81284e 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/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; |