aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-05-04 23:52:59 +0000
committerTed Kremenek <kremenek@apple.com>2009-05-04 23:52:59 +0000
commit6a08469ebe3e15262733841a9c29e2e563d78ba5 (patch)
tree3c12697624bac2e0774f9765c7dd25eaf06f3d38
parentd99b345a1ae77c746ef025e6a050908d69e2c543 (diff)
Rename attribute 'ns_ownership_returns' to 'ns_returns_ownership'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70941 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Parse/AttributeList.h2
-rw-r--r--lib/Parse/AttributeList.cpp4
-rw-r--r--lib/Sema/SemaDeclAttr.cpp4
-rw-r--r--test/Analysis/retain-release-gc-only.m2
-rw-r--r--test/Analysis/retain-release.m4
5 files changed, 8 insertions, 8 deletions
diff --git a/include/clang/Parse/AttributeList.h b/include/clang/Parse/AttributeList.h
index 24cfcb8d47..7693d02ff7 100644
--- a/include/clang/Parse/AttributeList.h
+++ b/include/clang/Parse/AttributeList.h
@@ -80,7 +80,7 @@ public:
AT_cf_ownership_retain, // Clang-specific.
AT_ns_ownership_release, // Clang-specific.
AT_ns_ownership_retain, // Clang-specific.
- AT_ns_ownership_returns, // Clang-specific.
+ AT_ns_returns_ownership, // Clang-specific.
AT_objc_gc,
AT_overloadable, // Clang-specific.
AT_packed,
diff --git a/lib/Parse/AttributeList.cpp b/lib/Parse/AttributeList.cpp
index 704d98a07e..d989d1de6e 100644
--- a/lib/Parse/AttributeList.cpp
+++ b/lib/Parse/AttributeList.cpp
@@ -144,8 +144,8 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
return AT_cf_ownership_release;
if (!memcmp(Str, "ns_ownership_release", 20))
return AT_ns_ownership_release;
- if (!memcmp(Str, "ns_ownership_returns", 20))
- return AT_ns_ownership_returns;
+ if (!memcmp(Str, "ns_returns_ownership", 20))
+ return AT_ns_returns_ownership;
break;
case 22:
if (!memcmp(Str, "no_instrument_function", 22))
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 2cd9713a42..29a0c6b977 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1552,7 +1552,7 @@ static void HandleNSOwnershipReturnsAttr(Decl *d, const AttributeList &Attr,
if (!isa<ObjCMethodDecl>(d) && !isa<FunctionDecl>(d)) {
S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) <<
- "ns_ownership_returns" << 3 /* function or method */;
+ "ns_returns_ownership" << 3 /* function or method */;
return;
}
@@ -1644,7 +1644,7 @@ static void ProcessDeclAttribute(Decl *D, const AttributeList &Attr, Sema &S) {
case AttributeList::AT_ns_ownership_release:
case AttributeList::AT_ns_ownership_retain:
HandleNSOwnershipAttr(D, Attr, S, true); break;
- case AttributeList::AT_ns_ownership_returns:
+ case AttributeList::AT_ns_returns_ownership:
HandleNSOwnershipReturnsAttr(D, Attr, S); break;
case AttributeList::AT_packed: HandlePackedAttr (D, Attr, S); break;
diff --git a/test/Analysis/retain-release-gc-only.m b/test/Analysis/retain-release-gc-only.m
index b4095837a9..8e261399e4 100644
--- a/test/Analysis/retain-release-gc-only.m
+++ b/test/Analysis/retain-release-gc-only.m
@@ -129,7 +129,7 @@ void f3() {
//===----------------------------------------------------------------------===//
@interface TestOwnershipAttr : NSObject
-- (NSString*) returnsAnOwnedString __attribute__((ns_ownership_returns));
+- (NSString*) returnsAnOwnedString __attribute__((ns_returns_ownership));
- (void) myRetain:(id)__attribute__((ns_ownership_retain))obj;
- (void) myCFRetain:(id)__attribute__((cf_ownership_retain))obj;
- (void) myRelease:(id)__attribute__((ns_ownership_release))obj;
diff --git a/test/Analysis/retain-release.m b/test/Analysis/retain-release.m
index 84225c7b09..393a99bfae 100644
--- a/test/Analysis/retain-release.m
+++ b/test/Analysis/retain-release.m
@@ -431,7 +431,7 @@ void rdar6704930(unsigned char *s, unsigned int length) {
//===----------------------------------------------------------------------===//
@interface TestOwnershipAttr : NSObject
-- (NSString*) returnsAnOwnedString __attribute__((ns_ownership_returns));
+- (NSString*) returnsAnOwnedString __attribute__((ns_returns_ownership));
- (void) myRetain:(id)__attribute__((ns_ownership_retain))obj;
- (void) myCFRetain:(id)__attribute__((cf_ownership_retain))obj;
- (void) myRelease:(id)__attribute__((ns_ownership_release))obj;
@@ -443,7 +443,7 @@ void rdar6704930(unsigned char *s, unsigned int length) {
@interface TestAttrHelper : NSObject
- (NSString*) createString:(TestOwnershipAttr*)X;
-- (NSString*) createStringAttr:(TestOwnershipAttr*)X __attribute__((ns_ownership_returns));
+- (NSString*) createStringAttr:(TestOwnershipAttr*)X __attribute__((ns_returns_ownership));
@end
@implementation TestAttrHelper