[cfe-commits] r150639 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/arc-ivar-layout.m

Fariborz Jahanian fjahanian at apple.com
Wed Feb 15 16:15:02 PST 2012


Author: fjahanian
Date: Wed Feb 15 18:15:02 2012
New Revision: 150639

URL: http://llvm.org/viewvc/llvm-project?rev=150639&view=rev
Log:
objc-arc: For arc's ivar layout, treat __unsafe_unretained ivars
as unscanned. // rdar://10832643

Modified:
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp
    cfe/trunk/test/CodeGenObjC/arc-ivar-layout.m

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=150639&r1=150638&r2=150639&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Wed Feb 15 18:15:02 2012
@@ -1730,6 +1730,10 @@
   if (FQT.isObjCGCWeak() || FQT.getObjCLifetime() == Qualifiers::OCL_Weak)
     return Qualifiers::Weak;
   
+  // check for __unsafe_unretained
+  if (FQT.getObjCLifetime() == Qualifiers::OCL_ExplicitNone)
+    return Qualifiers::GCNone;
+  
   if (FQT->isObjCObjectPointerType() || FQT->isBlockPointerType())
     return Qualifiers::Strong;
   

Modified: cfe/trunk/test/CodeGenObjC/arc-ivar-layout.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-ivar-layout.m?rev=150639&r1=150638&r2=150639&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-ivar-layout.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-ivar-layout.m Wed Feb 15 18:15:02 2012
@@ -42,3 +42,14 @@
 // CHECK-LP64: L_OBJC_CLASS_NAME_15:
 // CHECK-LP64-NEXT: .asciz	"\022"
 
+ at interface UnsafePerson {
+ at public
+    __unsafe_unretained id name;
+    __unsafe_unretained id age;
+    id value;
+}
+ at end
+
+ at implementation UnsafePerson @end
+// CHECK-LP64: L_OBJC_CLASS_NAME_20:
+// CHECK-LP64-NEXT: .asciz      "!"





More information about the cfe-commits mailing list