aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-08-28 19:52:12 +0000
committerTed Kremenek <kremenek@apple.com>2009-08-28 19:52:12 +0000
commita834fb43fddcf611ad248722fff1aa5b19807bed (patch)
treef1015f07e053ba64cb0ee49503ea493b151bce5f /lib/Analysis/CFRefCount.cpp
parentf53eaa59c4936f9b095e69557ce7366b26ca90cb (diff)
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
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 83eadee6f1..9cd59c2c14 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1461,7 +1461,9 @@ void RetainSummaryManager::InitializeMethodSummaries() {
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 @@ void RetainSummaryManager::InitializeMethodSummaries() {
"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);
}