diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-07-24 17:01:17 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-07-24 17:01:17 +0000 |
commit | b0f36323d9d8392075274b95816e2241f99ddb0d (patch) | |
tree | 3b9addc7c19ccc9aa81a03effb29659542285e47 /lib/Analysis/CheckDeadStores.cpp | |
parent | 940260996dfae2b6acd0466c1519b8e5083bed83 (diff) |
Issue dead store warnings for preincrements involved in a subexpression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CheckDeadStores.cpp')
-rw-r--r-- | lib/Analysis/CheckDeadStores.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/Analysis/CheckDeadStores.cpp b/lib/Analysis/CheckDeadStores.cpp index 433e61154f..4ab6680a78 100644 --- a/lib/Analysis/CheckDeadStores.cpp +++ b/lib/Analysis/CheckDeadStores.cpp @@ -152,12 +152,7 @@ public: else if (UnaryOperator* U = dyn_cast<UnaryOperator>(S)) { if (!U->isIncrementOp()) return; - - // Don't flag dead stores when the result of a preincrement/predecrement - // is used in an enclosing expression. - if (U->isPrefix() && Parents.isSubExpr(U)) - return; - + Expr *Ex = U->getSubExpr()->IgnoreParenCasts(); if (DeclRefExpr* DR = dyn_cast<DeclRefExpr>(Ex)) |