[llvm-branch-commits] [cfe-branch] r81130 - in /cfe/branches/Apple/Dib: lib/Sema/SemaDeclObjC.cpp test/CodeGenObjC/objc2-strong-cast-3.m

Fariborz Jahanian fjahanian at apple.com
Sun Sep 6 12:49:31 PDT 2009


Author: fjahanian
Date: Sun Sep  6 14:49:31 2009
New Revision: 81130

URL: http://llvm.org/viewvc/llvm-project?rev=81130&view=rev
Log:
Patch for radar 7200199.


Added:
    cfe/branches/Apple/Dib/test/CodeGenObjC/objc2-strong-cast-3.m
Modified:
    cfe/branches/Apple/Dib/lib/Sema/SemaDeclObjC.cpp

Modified: cfe/branches/Apple/Dib/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/Sema/SemaDeclObjC.cpp?rev=81130&r1=81129&r2=81130&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/branches/Apple/Dib/lib/Sema/SemaDeclObjC.cpp Sun Sep  6 14:49:31 2009
@@ -1975,7 +1975,9 @@
     // @synthesize
     if (!PropertyIvar)
       PropertyIvar = PropertyId;
-    QualType PropType = Context.getCanonicalType(property->getType());
+    // We cannot use canonical type for ivar type as when types are 'id' or 'Class'
+    // GC API generation logic must recognize these types as such.
+    QualType PropType = property->getType();
     // Check that this is a previously declared 'ivar' in 'IDecl' interface
     ObjCInterfaceDecl *ClassDeclared;
     Ivar = IDecl->lookupInstanceVariable(Context, PropertyIvar, ClassDeclared);

Added: cfe/branches/Apple/Dib/test/CodeGenObjC/objc2-strong-cast-3.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/test/CodeGenObjC/objc2-strong-cast-3.m?rev=81130&view=auto

==============================================================================
--- cfe/branches/Apple/Dib/test/CodeGenObjC/objc2-strong-cast-3.m (added)
+++ cfe/branches/Apple/Dib/test/CodeGenObjC/objc2-strong-cast-3.m Sun Sep  6 14:49:31 2009
@@ -0,0 +1,41 @@
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s &&
+// RUN: grep objc_assign_strongCast %t | count 6 &&
+// RUN: true
+
+ at interface I @end
+
+typedef I TI;
+typedef I* TPI;
+
+typedef id ID;
+
+ at interface MyClass {
+}
+
+ at property id property;
+ at property I* propertyI;
+
+ at property TI* propertyTI;
+
+ at property TPI propertyTPI;
+
+ at property ID propertyID;
+ at end
+
+ at implementation MyClass
+	@synthesize property=_property;
+        @synthesize propertyI;
+        @synthesize propertyTI=_propertyTI;
+        @synthesize propertyTPI=_propertyTPI;
+         @synthesize propertyID = _propertyID;
+ at end
+
+int main () {
+    MyClass *myObj;
+    myObj.property = 0;
+    myObj.propertyI = 0;
+    myObj.propertyTI = 0;
+    myObj.propertyTPI = 0;
+    myObj.propertyID = 0;
+    return 0;
+}





More information about the llvm-branch-commits mailing list