r233019 - [SDK modernizer PATCH]. Fixes a bug whereby a call to super

Fariborz Jahanian fjahanian at apple.com
Mon Mar 23 13:52:27 PDT 2015


Author: fjahanian
Date: Mon Mar 23 15:52:26 2015
New Revision: 233019

URL: http://llvm.org/viewvc/llvm-project?rev=233019&view=rev
Log:
[SDK modernizer PATCH]. Fixes a bug whereby a call to super
was not converted to property-dot syntax by removing an unused
code. rdar://19140267

Modified:
    cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
    cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m
    cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m.result

Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=233019&r1=233018&r2=233019&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Mon Mar 23 15:52:26 2015
@@ -255,11 +255,6 @@ namespace {
     if (!Method->isPropertyAccessor())
       return false;
     
-    const ObjCInterfaceDecl *IFace =
-      NS.getASTContext().getObjContainingInterface(Method);
-    if (!IFace)
-      return false;
-    
     const ObjCPropertyDecl *Prop = Method->findPropertyDecl();
     if (!Prop)
       return false;

Modified: cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m?rev=233019&r1=233018&r2=233019&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m (original)
+++ cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m Mon Mar 23 15:52:26 2015
@@ -3,8 +3,15 @@
 // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
 // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
 
+ at class NSString;
+
+// rdar://19140267
+ at protocol NSObject
+ at property (readonly, copy) NSString *description;
+ at end
+
 // rdar://18498572
- at interface NSObject @end
+ at interface NSObject <NSObject> @end
 
 @interface P : NSObject
 {
@@ -36,6 +43,8 @@ P* fun();
 }
 
 - (P*) MethodReturnsPObj { return 0; }
+
+- (NSString *)description { return [super description]; }
 @end
 
 // rdar://19140267

Modified: cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m.result?rev=233019&r1=233018&r2=233019&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m.result (original)
+++ cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m.result Mon Mar 23 15:52:26 2015
@@ -3,8 +3,15 @@
 // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
 // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
 
+ at class NSString;
+
+// rdar://19140267
+ at protocol NSObject
+ at property (readonly, copy) NSString *description;
+ at end
+
 // rdar://18498572
- at interface NSObject @end
+ at interface NSObject <NSObject> @end
 
 @interface P : NSObject
 {
@@ -36,6 +43,8 @@ P* fun();
 }
 
 - (P*) MethodReturnsPObj { return 0; }
+
+- (NSString *)description { return super.description; }
 @end
 
 // rdar://19140267
@@ -86,7 +95,7 @@ id testRdar19038838(Rdar19038838 *obj) {
 {
   obj.count = 100;
   [some setCount : [some count]];
-  [qsome setCount : [qsome count]];
+  qsome.count = qsome.count;
 }
 @end
 





More information about the cfe-commits mailing list