r192237 - ObjectiveC migrator: Add support for inferring

Fariborz Jahanian fjahanian at apple.com
Tue Oct 8 14:32:16 PDT 2013


Author: fjahanian
Date: Tue Oct  8 16:32:16 2013
New Revision: 192237

URL: http://llvm.org/viewvc/llvm-project?rev=192237&view=rev
Log:
ObjectiveC migrator: Add support for inferring 
properties of function pointer type.
// rdar://15082812

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

Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=192237&r1=192236&r2=192237&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Tue Oct  8 16:32:16 2013
@@ -247,9 +247,12 @@ void MigrateBlockOrFunctionPointerTypeVa
         paren--;
         break;
       case '^':
-        PropertyString += '^';
-        if (paren == 1)
+      case '*':
+        PropertyString += (*argPtr);
+        if (paren == 1) {
           PropertyString += name;
+          name = "";
+        }
         break;
       default:
         PropertyString += *argPtr;

Modified: cfe/trunk/test/ARCMT/objcmt-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property.m?rev=192237&r1=192236&r2=192237&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-property.m (original)
+++ cfe/trunk/test/ARCMT/objcmt-property.m Tue Oct  8 16:32:16 2013
@@ -223,4 +223,7 @@ DEPRECATED
 - (id (^)(id, NSArray *, NSMutableDictionary *)) expressionBlock;
 - (id (^)(id, NSArray *, NSMutableDictionary *)) MyBlock;
 - (void) setMyBlock : (id (^)(id, NSArray *, NSMutableDictionary *)) bl;
+- (id (*)(id, NSArray *, NSMutableDictionary *)) expressionFuncptr;
+- (id (*)(id, NSArray *, NSMutableDictionary *)) MyFuncptr;
+- (void) setMyFuncptr : (id (*)(id, NSArray *, NSMutableDictionary *)) bl;
 @end

Modified: cfe/trunk/test/ARCMT/objcmt-property.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property.m.result?rev=192237&r1=192236&r2=192237&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-property.m.result (original)
+++ cfe/trunk/test/ARCMT/objcmt-property.m.result Tue Oct  8 16:32:16 2013
@@ -223,4 +223,7 @@ DEPRECATED
 @property (nonatomic, readonly) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *);
 @property (nonatomic, copy) id (^MyBlock)(id, NSArray *, NSMutableDictionary *);
 
+ at property (nonatomic, readonly) id (*expressionFuncptr)(__strong id, NSArray *__strong, NSMutableDictionary *__strong);
+ at property (nonatomic) id (*MyFuncptr)(__strong id, NSArray *__strong, NSMutableDictionary *__strong);
+
 @end





More information about the cfe-commits mailing list