diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-02-22 00:34:10 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-02-22 00:34:10 +0000 |
commit | 5620631a0245255bfcdd00948b8598778526297d (patch) | |
tree | 865c6a66690d2b3b7de6fd48afbf550f19685217 | |
parent | 9c374179796b957e931dc05945b755ce1b21bb90 (diff) |
Bug fix in liveness: Only compute liveness information for VarDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47464 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Analysis/LiveVariables.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Analysis/LiveVariables.cpp b/Analysis/LiveVariables.cpp index eb1b56f37a..59039fb14a 100644 --- a/Analysis/LiveVariables.cpp +++ b/Analysis/LiveVariables.cpp @@ -119,12 +119,13 @@ void TransferFuncs::VisitUnaryOperator(UnaryOperator* U) { // 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. |