[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
This commit is contained in:
Jordan Rose
2012-07-26 20:04:08 +00:00
parent a4c0d21f42
commit b3244566f0

View File

@@ -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;