[cfe-commits] r47464 - /cfe/trunk/Analysis/LiveVariables.cpp

Ted Kremenek kremenek at apple.com
Thu Feb 21 16:34:10 PST 2008


Author: kremenek
Date: Thu Feb 21 18:34:10 2008
New Revision: 47464

URL: http://llvm.org/viewvc/llvm-project?rev=47464&view=rev
Log:
Bug fix in liveness: Only compute liveness information for VarDecls.

Modified:
    cfe/trunk/Analysis/LiveVariables.cpp

Modified: cfe/trunk/Analysis/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/LiveVariables.cpp?rev=47464&r1=47463&r2=47464&view=diff

==============================================================================
--- cfe/trunk/Analysis/LiveVariables.cpp (original)
+++ cfe/trunk/Analysis/LiveVariables.cpp Thu Feb 21 18:34:10 2008
@@ -119,12 +119,13 @@
     // Walk through the subexpressions, blasting through ParenExprs
     // until we either find a DeclRefExpr or some non-DeclRefExpr
     // expression.
-    if (DeclRefExpr* DR = dyn_cast<DeclRefExpr>(E->IgnoreParens())) {
-      // Treat the --/++/& operator as a kill.
-      LiveState(DR->getDecl(),AD) = Dead;
-      if (AD.Observer) { AD.Observer->ObserverKill(DR); }
-      return VisitDeclRefExpr(DR);
-    }
+    if (DeclRefExpr* DR = dyn_cast<DeclRefExpr>(E->IgnoreParens())) 
+      if (VarDecl* VD = dyn_cast<VarDecl>(DR->getDecl())) {        
+        // Treat the --/++/& operator as a kill.
+        LiveState(VD, AD) = Dead;
+        if (AD.Observer) { AD.Observer->ObserverKill(DR); }
+        return VisitDeclRefExpr(DR);
+      }
 
     // Fall-through.
   





More information about the cfe-commits mailing list