diff options
author | John McCall <rjmccall@apple.com> | 2011-07-07 06:58:02 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-07-07 06:58:02 +0000 |
commit | 4db5c3c83a22268ff0eeaa6ca7fd500668533487 (patch) | |
tree | 64decea6f573f5fce3cc231a02c8520270bc922c /clang/lib/AST/Stmt.cpp | |
parent | 54677c15f351d9caf35b88853d6bb54f055b27f7 (diff) | |
download | bcm5719-llvm-4db5c3c83a22268ff0eeaa6ca7fd500668533487.tar.gz bcm5719-llvm-4db5c3c83a22268ff0eeaa6ca7fd500668533487.zip |
In ARC, reclaim all return values of retainable type, not just those
where we have an immediate need of a retained value.
As an exception, don't do this when the call is made as the immediate
operand of a __bridge retain. This is more in the way of a workaround
than an actual guarantee, so it's acceptable to be brittle here.
rdar://problem/9504800
llvm-svn: 134605
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index e293f324aba..fd6f21d43b5 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -85,6 +85,18 @@ bool Stmt::CollectingStats(bool Enable) { return StatSwitch; } +Stmt *Stmt::IgnoreImplicit() { + Stmt *s = this; + + if (ExprWithCleanups *ewc = dyn_cast<ExprWithCleanups>(s)) + s = ewc->getSubExpr(); + + while (ImplicitCastExpr *ice = dyn_cast<ImplicitCastExpr>(s)) + s = ice->getSubExpr(); + + return s; +} + namespace { struct good {}; struct bad {}; |