aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ParentMap.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-02-12 00:17:19 +0000
committerTed Kremenek <kremenek@apple.com>2011-02-12 00:17:19 +0000
commitf4e532b5a1683a9f6c842f361c7415bf3474315f (patch)
tree64a235fb732ad821ee73e7a4dfbd3c75cc0710da /lib/AST/ParentMap.cpp
parent0a86d44703fc5cd3cd38ea1708176f5b44321ed8 (diff)
Don't emit a dead store for '++' operations unless it occurs with a return statement. We've never seen any other cases that were real bugs.
Fixes <rdar://problem/6962292>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ParentMap.cpp')
-rw-r--r--lib/AST/ParentMap.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/AST/ParentMap.cpp b/lib/AST/ParentMap.cpp
index 21847f2821..87f8f36e6e 100644
--- a/lib/AST/ParentMap.cpp
+++ b/lib/AST/ParentMap.cpp
@@ -57,6 +57,15 @@ Stmt *ParentMap::getParentIgnoreParens(Stmt *S) const {
return S;
}
+Stmt *ParentMap::getParentIgnoreParenCasts(Stmt *S) const {
+ do {
+ S = getParent(S);
+ }
+ while (S && (isa<ParenExpr>(S) || isa<CastExpr>(S)));
+
+ return S;
+}
+
bool ParentMap::isConsumedExpr(Expr* E) const {
Stmt *P = getParent(E);
Stmt *DirectChild = E;