aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index c8919c38cb..d3d0545e99 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1267,15 +1267,23 @@ RetainSummaryManager::updateSummaryFromAnnotations(RetainSummary &Summ,
if (!MD)
return;
+ bool isTrackedLoc = false;
+
// Determine if there is a special return effect for this method.
if (isTrackedObjCObjectType(MD->getResultType())) {
if (MD->getAttr<NSReturnsRetainedAttr>()) {
Summ.setRetEffect(ObjCAllocRetE);
+ return;
}
- else if (MD->getAttr<CFReturnsRetainedAttr>()) {
- Summ.setRetEffect(RetEffect::MakeOwned(RetEffect::CF, true));
- }
+
+ isTrackedLoc = true;
}
+
+ if (!isTrackedLoc)
+ isTrackedLoc = MD->getResultType()->getAsPointerType() != NULL;
+
+ if (isTrackedLoc && MD->getAttr<CFReturnsRetainedAttr>())
+ Summ.setRetEffect(RetEffect::MakeOwned(RetEffect::CF, true));
}
RetainSummary*