diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-08-28 19:52:12 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-08-28 19:52:12 +0000 |
commit | 52ac2b573578d34e054f21c27a23859646d56453 (patch) | |
tree | 724e759fd2b989c915233a181a254cbaff054b59 /clang/lib/Analysis/CFRefCount.cpp | |
parent | df5a1c8b5d2d5291969083ed68117105771a50f6 (diff) | |
download | bcm5719-llvm-52ac2b573578d34e054f21c27a23859646d56453.tar.gz bcm5719-llvm-52ac2b573578d34e054f21c27a23859646d56453.zip |
retain/release checker: [CIContext createCGImage...] and friends returned CF
objects that are not automatically garbage collected. This fixes
<rdar://problem/7174400>.
llvm-svn: 80387
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | clang/lib/Analysis/CFRefCount.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 83eadee6f11..9cd59c2c145 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/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); } |