Implement ownership attribute 'objc_ownership_make_collectable'. This allows one
to add 'CFMakeCollectable' semantics to a method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70336 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 538f4f2..e1483d6 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1121,6 +1121,10 @@
ScratchArgs.push_back(std::make_pair(i, DecRef));
hasArgEffect = true;
}
+ else if ((*I)->getAttr<ObjCOwnershipMakeCollectableAttr>()) {
+ ScratchArgs.push_back(std::make_pair(i, MakeCollectable));
+ hasArgEffect = true;
+ }
}
if (!hasRetEffect && !hasArgEffect)