diff options
| author | John McCall <rjmccall@apple.com> | 2011-06-16 23:24:51 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2011-06-16 23:24:51 +0000 |
| commit | fa27234afbf6b7816e04eef0da1f6f8b917563f5 (patch) | |
| tree | 0cf9acf50a49020baf393d40016151a018cbebbd | |
| parent | ea22bab7a5dba0380ed837395bc5417c7a3fb6d0 (diff) | |
| download | bcm5719-llvm-fa27234afbf6b7816e04eef0da1f6f8b917563f5.tar.gz bcm5719-llvm-fa27234afbf6b7816e04eef0da1f6f8b917563f5.zip | |
Be sure to try a final ARC-production even in Objective-C++.
llvm-svn: 133215
| -rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 2 | ||||
| -rw-r--r-- | clang/test/CodeGenObjCXX/arc.mm | 10 |
3 files changed, 13 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 77932151c1c..5bdadc6166b 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -3544,6 +3544,8 @@ InitializationSequence::InitializationSequence(Sema &S, SetFailed(InitializationSequence::FK_ConversionFailed); } else { AddConversionSequenceStep(ICS, Entity.getType()); + + MaybeProduceObjCObject(S, *this, Entity); } } diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 18e5f7e3a46..a5ad0a5a2b3 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -1787,7 +1787,7 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) { // overlap restriction of subclause 6.5.16.1 does not apply to the case of // function return. - // In C++ the return statement is handled via a copy initialization. + // In C++ the return statement is handled via a copy initialization, // the C version of which boils down to CheckSingleAssignmentConstraints. NRVOCandidate = getCopyElisionCandidate(FnRetType, RetValExp, false); InitializedEntity Entity = InitializedEntity::InitializeResult(ReturnLoc, diff --git a/clang/test/CodeGenObjCXX/arc.mm b/clang/test/CodeGenObjCXX/arc.mm index 5d46a818cff..43098553aaa 100644 --- a/clang/test/CodeGenObjCXX/arc.mm +++ b/clang/test/CodeGenObjCXX/arc.mm @@ -150,3 +150,13 @@ void test35b(Test35_Helper x0, Test35_Helper *x0p) { // CHECK: call void @objc_release // CHECK-NEXT: ret void } + +// rdar://problem/9603128 +// CHECK: define i8* @_Z6test36P11objc_object( +id test36(id z) { + // CHECK: objc_retain + // CHECK: objc_retain + // CHECK: objc_release + // CHECK: objc_autoreleaseReturnValue + return z; +} |

