summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-07-24 17:01:17 +0000
committerTed Kremenek <kremenek@apple.com>2008-07-24 17:01:17 +0000
commit87b16f4258ea42e33dbd74da3e51b3f6552a92d7 (patch)
tree7b3a180af5e374d5ec2ebc9519e12c6d894891d1 /clang/lib/Analysis
parent0f0aee213fa684e8ae70c870afa476e8eefb54fc (diff)
downloadbcm5719-llvm-87b16f4258ea42e33dbd74da3e51b3f6552a92d7.tar.gz
bcm5719-llvm-87b16f4258ea42e33dbd74da3e51b3f6552a92d7.zip
Issue dead store warnings for preincrements involved in a subexpression.
llvm-svn: 53983
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/CheckDeadStores.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/Analysis/CheckDeadStores.cpp b/clang/lib/Analysis/CheckDeadStores.cpp
index 433e61154f9..4ab6680a78d 100644
--- a/clang/lib/Analysis/CheckDeadStores.cpp
+++ b/clang/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))
OpenPOWER on IntegriCloud