r185879 - ObjC migration: Skip over setter/getter with attributes
Fariborz Jahanian
fjahanian at apple.com
Mon Jul 8 15:49:26 PDT 2013
Author: fjahanian
Date: Mon Jul 8 17:49:25 2013
New Revision: 185879
URL: http://llvm.org/viewvc/llvm-project?rev=185879&view=rev
Log:
ObjC migration: Skip over setter/getter with attributes
for now.
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=185879&r1=185878&r2=185879&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Mon Jul 8 17:49:25 2013
@@ -199,6 +199,10 @@ void ObjCMigrateASTConsumer::migrateObjC
QualType GRT = Method->getResultType();
if (GRT->isVoidType())
continue;
+ // FIXME. Don't know what todo with attributes, skip for now.
+ if (Method->hasAttrs())
+ continue;
+
Selector GetterSelector = Method->getSelector();
IdentifierInfo *getterName = GetterSelector.getIdentifierInfoForSlot(0);
Selector SetterSelector =
@@ -212,7 +216,8 @@ void ObjCMigrateASTConsumer::migrateObjC
continue;
const ParmVarDecl *argDecl = *SetterMethod->param_begin();
QualType ArgType = argDecl->getType();
- if (!Ctx.hasSameUnqualifiedType(ArgType, GRT))
+ if (!Ctx.hasSameUnqualifiedType(ArgType, GRT) ||
+ SetterMethod->hasAttrs())
continue;
edit::Commit commit(*Editor);
edit::rewriteToObjCProperty(Method, SetterMethod, *NSAPIObj, commit);
Modified: cfe/trunk/test/ARCMT/objcmt-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property.m?rev=185879&r1=185878&r2=185879&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-property.m (original)
+++ cfe/trunk/test/ARCMT/objcmt-property.m Mon Jul 8 17:49:25 2013
@@ -14,6 +14,16 @@
- (NSString *) StrongProp;
- (void) setStrongProp : (NSString *)Val;
+
+- (NSString *) UnavailProp __attribute__((unavailable));
+- (void) setUnavailProp : (NSString *)Val;
+
+- (NSString *) UnavailProp1 __attribute__((unavailable));
+- (void) setUnavailProp1 : (NSString *)Val __attribute__((unavailable));
+
+- (NSString *) UnavailProp2;
+- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
+
@end
@implementation I
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=185879&r1=185878&r2=185879&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-property.m.result (original)
+++ cfe/trunk/test/ARCMT/objcmt-property.m.result Mon Jul 8 17:49:25 2013
@@ -14,6 +14,16 @@
@property(strong) NSString * StrongProp;
+
+- (NSString *) UnavailProp __attribute__((unavailable));
+- (void) setUnavailProp : (NSString *)Val;
+
+- (NSString *) UnavailProp1 __attribute__((unavailable));
+- (void) setUnavailProp1 : (NSString *)Val __attribute__((unavailable));
+
+- (NSString *) UnavailProp2;
+- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
+
@end
@implementation I
More information about the cfe-commits
mailing list