[cfe-commits] r70884 - in /cfe/trunk: include/clang/AST/Attr.h include/clang/Parse/AttributeList.h lib/Analysis/CFRefCount.cpp lib/Frontend/PCHReaderDecl.cpp lib/Frontend/PCHWriter.cpp lib/Parse/AttributeList.cpp lib/Sema/SemaDeclAttr.cpp test/Analysis/retain-release-gc-only.m test/Analysis/retain-release.m
Ted Kremenek
kremenek at apple.com
Mon May 4 10:30:07 PDT 2009
Author: kremenek
Date: Mon May 4 12:29:57 2009
New Revision: 70884
URL: http://llvm.org/viewvc/llvm-project?rev=70884&view=rev
Log:
Rename attributes:
'objc_ownership_cfretain' -> 'cf_ownership_retain'
'objc_ownership_cfrelease' -> 'cf_ownership_release'
Motivation: Core Foundation objects can be used in isolation from Objective-C,
and this forces users to reason about the separate semantics of CF objects. More
Sema support pending.
Modified:
cfe/trunk/include/clang/AST/Attr.h
cfe/trunk/include/clang/Parse/AttributeList.h
cfe/trunk/lib/Analysis/CFRefCount.cpp
cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
cfe/trunk/lib/Frontend/PCHWriter.cpp
cfe/trunk/lib/Parse/AttributeList.cpp
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/test/Analysis/retain-release-gc-only.m
cfe/trunk/test/Analysis/retain-release.m
Modified: cfe/trunk/include/clang/AST/Attr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Attr.h?rev=70884&r1=70883&r2=70884&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Attr.h (original)
+++ cfe/trunk/include/clang/AST/Attr.h Mon May 4 12:29:57 2009
@@ -59,8 +59,8 @@
NonNull,
ObjCException,
ObjCNSObject,
- ObjCOwnershipCFRelease, // Clang/Checker-specific.
- ObjCOwnershipCFRetain, // Clang/Checker-specific.
+ CFOwnershipRelease, // Clang/Checker-specific.
+ CFOwnershipRetain, // Clang/Checker-specific.
ObjCOwnershipMakeCollectable, // Clang/Checker-specific.
ObjCOwnershipRelease, // Clang/Checker-specific.
ObjCOwnershipRetain, // Clang/Checker-specific.
@@ -466,9 +466,9 @@
};
// Checker-specific attributes.
-DEF_SIMPLE_ATTR(ObjCOwnershipCFRelease);
+DEF_SIMPLE_ATTR(CFOwnershipRelease);
DEF_SIMPLE_ATTR(ObjCOwnershipRelease);
-DEF_SIMPLE_ATTR(ObjCOwnershipCFRetain);
+DEF_SIMPLE_ATTR(CFOwnershipRetain);
DEF_SIMPLE_ATTR(ObjCOwnershipRetain);
DEF_SIMPLE_ATTR(ObjCOwnershipMakeCollectable);
DEF_SIMPLE_ATTR(ObjCOwnershipReturns);
Modified: cfe/trunk/include/clang/Parse/AttributeList.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/AttributeList.h?rev=70884&r1=70883&r2=70884&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/AttributeList.h (original)
+++ cfe/trunk/include/clang/Parse/AttributeList.h Mon May 4 12:29:57 2009
@@ -76,8 +76,8 @@
AT_nothrow,
AT_nsobject,
AT_objc_exception,
- AT_objc_ownership_cfrelease, // Clang-specific.
- AT_objc_ownership_cfretain, // Clang-specific.
+ AT_cf_ownership_release, // Clang-specific.
+ AT_cf_ownership_retain, // Clang-specific.
AT_objc_ownership_make_collectable, // Clang-specific.
AT_objc_ownership_release, // Clang-specific.
AT_objc_ownership_retain, // Clang-specific.
Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=70884&r1=70883&r2=70884&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Mon May 4 12:29:57 2009
@@ -1107,11 +1107,11 @@
const ParmVarDecl *PD){
if (PD->getAttr<ObjCOwnershipRetainAttr>())
Summ.setArgEffect(AF, i, IncRefMsg);
- else if (PD->getAttr<ObjCOwnershipCFRetainAttr>())
+ else if (PD->getAttr<CFOwnershipRetainAttr>())
Summ.setArgEffect(AF, i, IncRef);
else if (PD->getAttr<ObjCOwnershipReleaseAttr>())
Summ.setArgEffect(AF, i, DecRefMsg);
- else if (PD->getAttr<ObjCOwnershipCFReleaseAttr>())
+ else if (PD->getAttr<CFOwnershipReleaseAttr>())
Summ.setArgEffect(AF, i, DecRef);
else if (PD->getAttr<ObjCOwnershipMakeCollectableAttr>())
Summ.setArgEffect(AF, i, MakeCollectable);
Modified: cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReaderDecl.cpp?rev=70884&r1=70883&r2=70884&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReaderDecl.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReaderDecl.cpp Mon May 4 12:29:57 2009
@@ -475,8 +475,8 @@
SIMPLE_ATTR(ObjCException);
SIMPLE_ATTR(ObjCNSObject);
- SIMPLE_ATTR(ObjCOwnershipCFRelease);
- SIMPLE_ATTR(ObjCOwnershipCFRetain);
+ SIMPLE_ATTR(CFOwnershipRelease);
+ SIMPLE_ATTR(CFOwnershipRetain);
SIMPLE_ATTR(ObjCOwnershipMakeCollectable);
SIMPLE_ATTR(ObjCOwnershipRelease);
SIMPLE_ATTR(ObjCOwnershipRetain);
Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=70884&r1=70883&r2=70884&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Mon May 4 12:29:57 2009
@@ -1549,8 +1549,8 @@
case Attr::ObjCException:
case Attr::ObjCNSObject:
- case Attr::ObjCOwnershipCFRelease:
- case Attr::ObjCOwnershipCFRetain:
+ case Attr::CFOwnershipRelease:
+ case Attr::CFOwnershipRetain:
case Attr::ObjCOwnershipMakeCollectable:
case Attr::ObjCOwnershipRelease:
case Attr::ObjCOwnershipRetain:
Modified: cfe/trunk/lib/Parse/AttributeList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/AttributeList.cpp?rev=70884&r1=70883&r2=70884&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/AttributeList.cpp (original)
+++ cfe/trunk/lib/Parse/AttributeList.cpp Mon May 4 12:29:57 2009
@@ -133,6 +133,14 @@
case 18:
if (!memcmp(Str, "warn_unused_result", 18)) return AT_warn_unused_result;
break;
+ case 19:
+ if (!memcmp(Str, "cf_ownership_retain", 19))
+ return AT_cf_ownership_retain;
+ break;
+ case 20:
+ if (!memcmp(Str, "cf_ownership_release", 20))
+ return AT_cf_ownership_release;
+ break;
case 21:
if (!memcmp(Str, "objc_ownership_retain", 21))
return AT_objc_ownership_retain;
@@ -145,14 +153,6 @@
if (!memcmp(Str, "no_instrument_function", 22))
return AT_no_instrument_function;
break;
- case 23:
- if (!memcmp(Str, "objc_ownership_cfretain", 23))
- return AT_objc_ownership_cfretain;
- break;
- case 24:
- if (!memcmp(Str, "objc_ownership_cfrelease", 24))
- return AT_objc_ownership_cfrelease;
- break;
case 31:
if (!memcmp(Str, "objc_ownership_make_collectable", 31))
return AT_objc_ownership_make_collectable;
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=70884&r1=70883&r2=70884&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Mon May 4 12:29:57 2009
@@ -1569,10 +1569,10 @@
default:
assert(0 && "invalid ownership attribute");
return;
- case AttributeList::AT_objc_ownership_cfrelease:
- name = "objc_ownership_cfrelease"; break;
- case AttributeList::AT_objc_ownership_cfretain:
- name = "objc_ownership_cfretain"; break;
+ case AttributeList::AT_cf_ownership_release:
+ name = "cf_ownership_release"; break;
+ case AttributeList::AT_cf_ownership_retain:
+ name = "cf_ownership_retain"; break;
case AttributeList::AT_objc_ownership_make_collectable:
name = "objc_ownership_make_collectable"; break;
case AttributeList::AT_objc_ownership_release:
@@ -1591,10 +1591,10 @@
default:
assert(0 && "invalid ownership attribute");
return;
- case AttributeList::AT_objc_ownership_cfrelease:
- d->addAttr(::new (S.Context) ObjCOwnershipCFReleaseAttr()); return;
- case AttributeList::AT_objc_ownership_cfretain:
- d->addAttr(::new (S.Context) ObjCOwnershipCFRetainAttr()); return;
+ case AttributeList::AT_cf_ownership_release:
+ d->addAttr(::new (S.Context) CFOwnershipReleaseAttr()); return;
+ case AttributeList::AT_cf_ownership_retain:
+ d->addAttr(::new (S.Context) CFOwnershipRetainAttr()); return;
case AttributeList::AT_objc_ownership_make_collectable:
d->addAttr(::new (S.Context) ObjCOwnershipMakeCollectableAttr()); return;
case AttributeList::AT_objc_ownership_release:
@@ -1642,8 +1642,8 @@
case AttributeList::AT_nothrow: HandleNothrowAttr (D, Attr, S); break;
// Checker-specific.
- case AttributeList::AT_objc_ownership_cfrelease:
- case AttributeList::AT_objc_ownership_cfretain:
+ case AttributeList::AT_cf_ownership_release:
+ case AttributeList::AT_cf_ownership_retain:
HandleObjCOwnershipAttr(D, Attr, S); break;
case AttributeList::AT_objc_ownership_make_collectable:
case AttributeList::AT_objc_ownership_release:
Modified: cfe/trunk/test/Analysis/retain-release-gc-only.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release-gc-only.m?rev=70884&r1=70883&r2=70884&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release-gc-only.m (original)
+++ cfe/trunk/test/Analysis/retain-release-gc-only.m Mon May 4 12:29:57 2009
@@ -131,9 +131,9 @@
@interface TestOwnershipAttr : NSObject
- (NSString*) returnsAnOwnedString __attribute__((objc_ownership_returns));
- (void) myRetain:(id)__attribute__((objc_ownership_retain))obj;
-- (void) myCFRetain:(id)__attribute__((objc_ownership_cfretain))obj;
+- (void) myCFRetain:(id)__attribute__((cf_ownership_retain))obj;
- (void) myRelease:(id)__attribute__((objc_ownership_release))obj;
-- (void) myCFRelease:(id)__attribute__((objc_ownership_cfrelease))obj;
+- (void) myCFRelease:(id)__attribute__((cf_ownership_release))obj;
- (void) makeCollectable:(id)__attribute__((objc_ownership_make_collectable))obj;
@end
Modified: cfe/trunk/test/Analysis/retain-release.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release.m?rev=70884&r1=70883&r2=70884&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release.m (original)
+++ cfe/trunk/test/Analysis/retain-release.m Mon May 4 12:29:57 2009
@@ -433,9 +433,9 @@
@interface TestOwnershipAttr : NSObject
- (NSString*) returnsAnOwnedString __attribute__((objc_ownership_returns));
- (void) myRetain:(id)__attribute__((objc_ownership_retain))obj;
-- (void) myCFRetain:(id)__attribute__((objc_ownership_cfretain))obj;
+- (void) myCFRetain:(id)__attribute__((cf_ownership_retain))obj;
- (void) myRelease:(id)__attribute__((objc_ownership_release))obj;
-- (void) myCFRelease:(id)__attribute__((objc_ownership_cfrelease))obj;
+- (void) myCFRelease:(id)__attribute__((cf_ownership_release))obj;
- (void) myRetain __attribute__((objc_ownership_retain));
- (void) myRelease __attribute__((objc_ownership_release));
More information about the cfe-commits
mailing list