]> granicus.if.org Git - clang/commitdiff
ObjectiveC migrator: Donlt annotate NS_RETURNS_INNER_POINTER
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 26 Sep 2013 22:43:41 +0000 (22:43 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 26 Sep 2013 22:43:41 +0000 (22:43 +0000)
on class methods, as it makes no sense. // rdar://15069200

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

lib/ARCMigrate/ObjCMT.cpp
test/ARCMT/objcmt-ns-returns-inner-pointer.m
test/ARCMT/objcmt-ns-returns-inner-pointer.m.result

index 997f951d7c5438cdd99d6b6c1406c8c9f4ee0fe4..ca1d189ca33c7eaf4aee9800ebf41dfe186c8eb7 100644 (file)
@@ -846,6 +846,7 @@ bool ObjCMigrateASTConsumer::migrateProperty(ASTContext &Ctx,
 void ObjCMigrateASTConsumer::migrateNsReturnsInnerPointer(ASTContext &Ctx,
                                                           ObjCMethodDecl *OM) {
   if (OM->isImplicit() ||
+      !OM->isInstanceMethod() ||
       OM->hasAttr<ObjCReturnsInnerPointerAttr>())
     return;
   
index 42cbdb8e5167ec117140c8942abf95ffd8ab812c..147de16e8e47e4fd146af7c306a5b5543a206b0a 100644 (file)
@@ -122,6 +122,8 @@ typedef void *SecTrustRef;
 
 - (SecTrustRef) FOO1 NS_AVAILABLE;
 
++ (const NSURLProtectionSpace *)ProtectionSpace;
+
 // pointer personality functions
 @property NSUInteger (*hashFunction)(const void *item, NSUInteger (*size)(const void *item));
 @end
index 389cb8853a6e3b21178b6877f05bc8415c09ed74..ea5becc56380b01ce96c4fb15b7c74c26aae170b 100644 (file)
@@ -122,6 +122,8 @@ typedef void *SecTrustRef;
 
 - (SecTrustRef) FOO1 NS_AVAILABLE NS_RETURNS_INNER_POINTER;
 
++ (const NSURLProtectionSpace *)ProtectionSpace;
+
 // pointer personality functions
 @property NSUInteger (*hashFunction)(const void *item, NSUInteger (*size)(const void *item));
 @end