Add two new checker-specific attributes: 'objc_ownership_release' and
'objc_ownership_cfrelease'. These are the 'release' equivalents of
'objc_ownership_retain' and 'objc_ownership_cfretain' respectively.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70235 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 8f07b2c..538f4f2 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1112,7 +1112,15 @@
else if ((*I)->getAttr<ObjCOwnershipCFRetainAttr>()) {
ScratchArgs.push_back(std::make_pair(i, IncRef));
hasArgEffect = true;
- }
+ }
+ else if ((*I)->getAttr<ObjCOwnershipReleaseAttr>()) {
+ ScratchArgs.push_back(std::make_pair(i, DecRefMsg));
+ hasArgEffect = true;
+ }
+ else if ((*I)->getAttr<ObjCOwnershipCFReleaseAttr>()) {
+ ScratchArgs.push_back(std::make_pair(i, DecRef));
+ hasArgEffect = true;
+ }
}
if (!hasRetEffect && !hasArgEffect)