aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-05-20 22:39:57 +0000
committerTed Kremenek <kremenek@apple.com>2009-05-20 22:39:57 +0000
commit767d649c5353ca19c5a1e181783240a0994bb20a (patch)
tree03daf89f2de34e136adbcab8fddb6fe1b1f0af21 /lib/Analysis/CFRefCount.cpp
parentd7e2705961bacb9df5d9119403c01c9b04aff97f (diff)
Add special cases to retain checker for 'create' methods in QCView, QCRenderer, and CIContext (Apple APIs).
This fixes: <rdar://problem/6902710> clang: false positives w/QC and CoreImage methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72187 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index d3f6ffbb60..30ff67f4a5 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1371,17 +1371,17 @@ void RetainSummaryManager::InitializeMethodSummaries() {
DecRefMsg));
// The next methods are allocators.
- RetainSummary* Summ = getPersistentSummary(ObjCAllocRetE);
+ RetainSummary *AllocSumm = getPersistentSummary(ObjCAllocRetE);
// Create the "copy" selector.
- addNSObjectMethSummary(GetNullarySelector("copy", Ctx), Summ);
+ addNSObjectMethSummary(GetNullarySelector("copy", Ctx), AllocSumm);
// Create the "mutableCopy" selector.
- addNSObjectMethSummary(GetNullarySelector("mutableCopy", Ctx), Summ);
+ addNSObjectMethSummary(GetNullarySelector("mutableCopy", Ctx), AllocSumm);
// Create the "retain" selector.
RetEffect E = RetEffect::MakeReceiverAlias();
- Summ = getPersistentSummary(E, IncRefMsg);
+ RetainSummary *Summ = getPersistentSummary(E, IncRefMsg);
addNSObjectMethSummary(GetNullarySelector("retain", Ctx), Summ);
// Create the "release" selector.
@@ -1449,6 +1449,18 @@ void RetainSummaryManager::InitializeMethodSummaries() {
addPanicSummary("NSAssertionHandler", "handleFailureInMethod", "object",
"file", "lineNumber", "description", NULL);
+
+ // Create summaries QCRenderer/QCView -createSnapShotImageOfType:
+ addInstMethSummary("QCRenderer", AllocSumm,
+ "createSnapshotImageOfType", NULL);
+ addInstMethSummary("QCView", AllocSumm,
+ "createSnapshotImageOfType", NULL);
+
+ // Create summaries for CIContext, 'createCGImage'.
+ addInstMethSummary("CIContext", AllocSumm,
+ "createCGImage", "fromRect", NULL);
+ addInstMethSummary("CIContext", AllocSumm,
+ "createCGImage", "fromRect", "format", "colorSpace", NULL);
}
//===----------------------------------------------------------------------===//