From 6a08469ebe3e15262733841a9c29e2e563d78ba5 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 4 May 2009 23:52:59 +0000 Subject: [PATCH] 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 --- include/clang/Parse/AttributeList.h | 2 +- lib/Parse/AttributeList.cpp | 4 ++-- lib/Sema/SemaDeclAttr.cpp | 4 ++-- test/Analysis/retain-release-gc-only.m | 2 +- test/Analysis/retain-release.m | 4 ++-- 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(d) && !isa(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 -- 2.40.0