[cfe-commits] r133215 - in /cfe/trunk: lib/Sema/SemaInit.cpp lib/Sema/SemaStmt.cpp test/CodeGenObjCXX/arc.mm

John McCall rjmccall at apple.com
Thu Jun 16 16:24:51 PDT 2011


Author: rjmccall
Date: Thu Jun 16 18:24:51 2011
New Revision: 133215

URL: http://llvm.org/viewvc/llvm-project?rev=133215&view=rev
Log:
Be sure to try a final ARC-production even in Objective-C++.


Modified:
    cfe/trunk/lib/Sema/SemaInit.cpp
    cfe/trunk/lib/Sema/SemaStmt.cpp
    cfe/trunk/test/CodeGenObjCXX/arc.mm

Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=133215&r1=133214&r2=133215&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Thu Jun 16 18:24:51 2011
@@ -3544,6 +3544,8 @@
       SetFailed(InitializationSequence::FK_ConversionFailed);
   } else {
     AddConversionSequenceStep(ICS, Entity.getType());
+
+    MaybeProduceObjCObject(S, *this, Entity);
   }
 }
 

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=133215&r1=133214&r2=133215&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Thu Jun 16 18:24:51 2011
@@ -1787,7 +1787,7 @@
       // 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,

Modified: cfe/trunk/test/CodeGenObjCXX/arc.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc.mm?rev=133215&r1=133214&r2=133215&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/arc.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/arc.mm Thu Jun 16 18:24:51 2011
@@ -150,3 +150,13 @@
   // 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;
+}





More information about the cfe-commits mailing list