]> granicus.if.org Git - clang/commitdiff
ObjectiveC migrator. More testing of instancetype migration in
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 11 Nov 2013 18:54:23 +0000 (18:54 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 11 Nov 2013 18:54:23 +0000 (18:54 +0000)
method implementations. // rdar://15438505

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194402 91177308-0d34-0410-b5e6-96231b3b80d8

test/ARCMT/objcmt-instancetype.m
test/ARCMT/objcmt-instancetype.m.result

index b25f9d884939125130226203439abde59e5b0bf9..47dbd7aeed5a1a666166759f7e30715648f16270 100644 (file)
@@ -15,6 +15,11 @@ typedef signed char BOOL;
 - (id)initWithString:(NSString *)aString;
 @end
 
+@implementation NSString : NSObject
++ (id)stringWithString:(NSString *)string { return 0; };
+- (instancetype)initWithString:(NSString *)aString { return 0; };
+@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
 
+@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; }
+@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
 
+@implementation NSNumber (NSNumberCreation)
++ (NSNumber *)numberWithInt:(int)value { return 0; }
+@end
+
 #define M(x) (x)
 #define PAIR(x) @#x, [NSNumber numberWithInt:(x)]
 #define TWO(x) ((x), (x))
index a355d13c4241f3f0cc0bcf782e38cf4cee43d3e8..ce51678708dd8a030462ce36db40c514d7666f74 100644 (file)
@@ -15,6 +15,11 @@ typedef signed char BOOL;
 - (instancetype)initWithString:(NSString *)aString;
 @end
 
+@implementation NSString : NSObject
++ (instancetype)stringWithString:(NSString *)string { return 0; };
+- (instancetype)initWithString:(NSString *)aString { return 0; };
+@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
 
+@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; }
+@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
 
+@implementation NSNumber (NSNumberCreation)
++ (NSNumber *)numberWithInt:(int)value { return 0; }
+@end
+
 #define M(x) (x)
 #define PAIR(x) @#x, [NSNumber numberWithInt:(x)]
 #define TWO(x) ((x), (x))