r194402 - ObjectiveC migrator. More testing of instancetype migration in

Fariborz Jahanian fjahanian at apple.com
Mon Nov 11 10:54:23 PST 2013


Author: fjahanian
Date: Mon Nov 11 12:54:23 2013
New Revision: 194402

URL: http://llvm.org/viewvc/llvm-project?rev=194402&view=rev
Log:
ObjectiveC migrator. More testing of instancetype migration in
method implementations. // rdar://15438505

Modified:
    cfe/trunk/test/ARCMT/objcmt-instancetype.m
    cfe/trunk/test/ARCMT/objcmt-instancetype.m.result

Modified: cfe/trunk/test/ARCMT/objcmt-instancetype.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-instancetype.m?rev=194402&r1=194401&r2=194402&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-instancetype.m (original)
+++ cfe/trunk/test/ARCMT/objcmt-instancetype.m Mon Nov 11 12:54:23 2013
@@ -15,6 +15,11 @@ typedef signed char BOOL;
 - (id)initWithString:(NSString *)aString;
 @end
 
+ at implementation NSString : NSObject
++ (id)stringWithString:(NSString *)string { return 0; };
+- (instancetype)initWithString:(NSString *)aString { return 0; };
+ at end
+
 @interface NSArray : NSObject
 - (id)objectAtIndex:(unsigned long)index;
 - (id)objectAtIndexedSubscript:(int)index;
@@ -34,6 +39,25 @@ typedef signed char BOOL;
 - (id)objectAtIndex:(unsigned long)index;
 @end
 
+ at implementation NSArray (NSArrayCreation)
++ (id)array { return 0; }
++ (id)arrayWithObject:(id)anObject {
+  return anObject;
+}
++ (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt { return 0; }
++ (id)arrayWithObjects:(id)firstObj, ... {
+  return 0; }
++ arrayWithArray:(NSArray *)array {
+  return 0;
+}
+
+- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt { return 0; }
+- (id)initWithObjects:(id)firstObj, ... { return 0; }
+- (id)initWithArray:(NSArray *)array { return 0; }
+
+- (id)objectAtIndex:(unsigned long)index { return 0; }
+ at end
+
 @interface NSMutableArray : NSArray
 - (void)replaceObjectAtIndex:(unsigned long)index withObject:(id)anObject;
 - (void)setObject:(id)object atIndexedSubscript:(int)index;
@@ -71,6 +95,10 @@ typedef signed char BOOL;
 + (NSNumber *)numberWithInt:(int)value;
 @end
 
+ at implementation NSNumber (NSNumberCreation)
++ (NSNumber *)numberWithInt:(int)value { return 0; }
+ at end
+
 #define M(x) (x)
 #define PAIR(x) @#x, [NSNumber numberWithInt:(x)]
 #define TWO(x) ((x), (x))

Modified: cfe/trunk/test/ARCMT/objcmt-instancetype.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-instancetype.m.result?rev=194402&r1=194401&r2=194402&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-instancetype.m.result (original)
+++ cfe/trunk/test/ARCMT/objcmt-instancetype.m.result Mon Nov 11 12:54:23 2013
@@ -15,6 +15,11 @@ typedef signed char BOOL;
 - (instancetype)initWithString:(NSString *)aString;
 @end
 
+ at implementation NSString : NSObject
++ (instancetype)stringWithString:(NSString *)string { return 0; };
+- (instancetype)initWithString:(NSString *)aString { return 0; };
+ at end
+
 @interface NSArray : NSObject
 - (id)objectAtIndex:(unsigned long)index;
 - (id)objectAtIndexedSubscript:(int)index;
@@ -34,6 +39,25 @@ typedef signed char BOOL;
 - (id)objectAtIndex:(unsigned long)index;
 @end
 
+ at implementation NSArray (NSArrayCreation)
++ (instancetype)array { return 0; }
++ (instancetype)arrayWithObject:(id)anObject {
+  return anObject;
+}
++ (instancetype)arrayWithObjects:(const id [])objects count:(unsigned long)cnt { return 0; }
++ (instancetype)arrayWithObjects:(id)firstObj, ... {
+  return 0; }
++ (instancetype) arrayWithArray:(NSArray *)array {
+  return 0;
+}
+
+- (instancetype)initWithObjects:(const id [])objects count:(unsigned long)cnt { return 0; }
+- (instancetype)initWithObjects:(id)firstObj, ... { return 0; }
+- (instancetype)initWithArray:(NSArray *)array { return 0; }
+
+- (id)objectAtIndex:(unsigned long)index { return 0; }
+ at end
+
 @interface NSMutableArray : NSArray
 - (void)replaceObjectAtIndex:(unsigned long)index withObject:(id)anObject;
 - (void)setObject:(id)object atIndexedSubscript:(int)index;
@@ -71,6 +95,10 @@ typedef signed char BOOL;
 + (NSNumber *)numberWithInt:(int)value;
 @end
 
+ at implementation NSNumber (NSNumberCreation)
++ (NSNumber *)numberWithInt:(int)value { return 0; }
+ at end
+
 #define M(x) (x)
 #define PAIR(x) @#x, [NSNumber numberWithInt:(x)]
 #define TWO(x) ((x), (x))





More information about the cfe-commits mailing list