retain/release checker: [CIContext createCGImage...] and friends returned CF
objects that are not automatically garbage collected. This fixes
<rdar://problem/7174400>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80387 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 83eadee..9cd59c2 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1461,7 +1461,9 @@
InitSumm);
// The next methods are allocators.
- RetainSummary *AllocSumm = getPersistentSummary(ObjCAllocRetE);
+ RetainSummary *AllocSumm = getPersistentSummary(ObjCAllocRetE);
+ RetainSummary *CFAllocSumm =
+ getPersistentSummary(RetEffect::MakeOwned(RetEffect::CF, true));
// Create the "copy" selector.
addNSObjectMethSummary(GetNullarySelector("copy", Ctx), AllocSumm);
@@ -1547,12 +1549,13 @@
"createSnapshotImageOfType", NULL);
// Create summaries for CIContext, 'createCGImage' and
- // 'createCGLayerWithSize'.
- addInstMethSummary("CIContext", AllocSumm,
+ // 'createCGLayerWithSize'. These objects are CF objects, and are not
+ // automatically garbage collected.
+ addInstMethSummary("CIContext", CFAllocSumm,
"createCGImage", "fromRect", NULL);
- addInstMethSummary("CIContext", AllocSumm,
+ addInstMethSummary("CIContext", CFAllocSumm,
"createCGImage", "fromRect", "format", "colorSpace", NULL);
- addInstMethSummary("CIContext", AllocSumm, "createCGLayerWithSize",
+ addInstMethSummary("CIContext", CFAllocSumm, "createCGLayerWithSize",
"info", NULL);
}