Bug fix in liveness: Only compute liveness information for VarDecls.

llvm-svn: 47464
This commit is contained in:
Ted Kremenek 2008-02-22 00:34:10 +00:00
parent eb653882de
commit 20c91421fe
1 changed files with 7 additions and 6 deletions

View File

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