ObjCMethodDecl *OM);
bool migrateProperty(ASTContext &Ctx, ObjCContainerDecl *D, ObjCMethodDecl *OM);
void migrateNsReturnsInnerPointer(ASTContext &Ctx, ObjCMethodDecl *OM);
+ void migratePropertyNsReturnsInnerPointer(ASTContext &Ctx, ObjCPropertyDecl *P);
void migrateFactoryMethod(ASTContext &Ctx, ObjCContainerDecl *CDecl,
ObjCMethodDecl *OM,
ObjCInstanceTypeFamily OIT_Family = OIT_None);
ObjCMethodDecl *Method = (*M);
if (Method->isDeprecated())
continue;
- if (!migrateProperty(Ctx, D, Method))
- migrateNsReturnsInnerPointer(Ctx, Method);
+ migrateProperty(Ctx, D, Method);
+ migrateNsReturnsInnerPointer(Ctx, Method);
+ }
+ for (ObjCContainerDecl::prop_iterator P = D->prop_begin(),
+ E = D->prop_end(); P != E; ++P) {
+ ObjCPropertyDecl *Prop = *P;
+ if (!P->isDeprecated())
+ migratePropertyNsReturnsInnerPointer(Ctx, Prop);
}
}
void ObjCMigrateASTConsumer::migrateNsReturnsInnerPointer(ASTContext &Ctx,
ObjCMethodDecl *OM) {
- if (OM->hasAttr<ObjCReturnsInnerPointerAttr>())
+ if (OM->isImplicit() ||
+ OM->hasAttr<ObjCReturnsInnerPointerAttr>())
return;
QualType RT = OM->getResultType();
Editor->commit(commit);
}
+void ObjCMigrateASTConsumer::migratePropertyNsReturnsInnerPointer(ASTContext &Ctx,
+ ObjCPropertyDecl *P) {
+ QualType T = P->getType();
+
+ if (!TypeIsInnerPointer(T) ||
+ !Ctx.Idents.get("NS_RETURNS_INNER_POINTER").hasMacroDefinition())
+ return;
+ edit::Commit commit(*Editor);
+ commit.insertBefore(P->getLocEnd(), " NS_RETURNS_INNER_POINTER ");
+ Editor->commit(commit);
+}
+
void ObjCMigrateASTConsumer::migrateMethods(ASTContext &Ctx,
ObjCContainerDecl *CDecl) {
if (CDecl->isDeprecated())
#define NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
#endif
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+
CF_IMPLICIT_BRIDGING_ENABLED
typedef unsigned long CFTypeID;
- (TTJSObjectRef)JSObject1;
- (JSObjectRef*)JSObject2;
@end
+
+// rdar://15044991
+typedef void *SecTrustRef;
+
+@interface NSURLProtectionSpace
+@property (readonly) SecTrustRef serverTrust NS_AVAILABLE;
+- (void *) FOO NS_AVAILABLE;
+@property (readonly) void * mitTrust NS_AVAILABLE;
+
+@property (readonly) void * mittiTrust;
+
+@property (readonly) SecTrustRef XserverTrust;
+
+- (SecTrustRef) FOO1 NS_AVAILABLE;
+
+@end
#define NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
#endif
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+
CF_IMPLICIT_BRIDGING_ENABLED
typedef unsigned long CFTypeID;
- (TTJSObjectRef)JSObject1;
- (JSObjectRef*)JSObject2 NS_RETURNS_INNER_POINTER;
@end
+
+// rdar://15044991
+typedef void *SecTrustRef;
+
+@interface NSURLProtectionSpace
+@property (readonly) SecTrustRef NS_RETURNS_INNER_POINTER serverTrust NS_AVAILABLE;
+- (void *) FOO NS_AVAILABLE NS_RETURNS_INNER_POINTER;
+@property (readonly) void * NS_RETURNS_INNER_POINTER mitTrust NS_AVAILABLE;
+
+@property (readonly) void * NS_RETURNS_INNER_POINTER mittiTrust;
+
+@property (readonly) SecTrustRef NS_RETURNS_INNER_POINTER XserverTrust;
+
+- (SecTrustRef) FOO1 NS_AVAILABLE NS_RETURNS_INNER_POINTER;
+
+@end