[cfe-commits] r160805 - /cfe/trunk/lib/Analysis/LiveVariables.cpp

Jordan Rose jordan_rose at apple.com
Thu Jul 26 13:04:08 PDT 2012


Author: jrose
Date: Thu Jul 26 15:04:08 2012
New Revision: 160805

URL: http://llvm.org/viewvc/llvm-project?rev=160805&view=rev
Log:
[analyzer] Variables with destructors are live until the destructor is run.

Test case in the next commit, which enables destructors under certain
circumstances.

Modified:
    cfe/trunk/lib/Analysis/LiveVariables.cpp

Modified: cfe/trunk/lib/Analysis/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/LiveVariables.cpp?rev=160805&r1=160804&r2=160805&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/LiveVariables.cpp (original)
+++ cfe/trunk/lib/Analysis/LiveVariables.cpp Thu Jul 26 15:04:08 2012
@@ -455,6 +455,12 @@
   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;
     





More information about the cfe-commits mailing list