From 7e5e5f4cc36fe50f46ad76dca7a266434c94f475 Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 7 Jul 2011 06:58:02 +0000 Subject: 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134605 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index d9e565a440..289eaa08fb 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -2011,7 +2011,8 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { case CK_MemberPointerToBoolean: case CK_AnyPointerToBlockPointerCast: case CK_ObjCProduceObject: - case CK_ObjCConsumeObject: { + case CK_ObjCConsumeObject: + case CK_ObjCReclaimReturnedObject: { // These casts only produce lvalues when we're binding a reference to a // temporary realized from a (converted) pure rvalue. Emit the expression // as a value, copy it into a temporary, and return an lvalue referring to -- cgit v1.2.3