summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-05-07 04:25:59 +0000
committerTed Kremenek <kremenek@apple.com>2008-05-07 04:25:59 +0000
commit9930bd8c4f778145c97a8baa2e6d0311cfa89e2e (patch)
treeef4360ee7980b5ab4b7b41ce6d45443843c948dc /clang/lib/Analysis/CFRefCount.cpp
parent08eb30f193c9097538eae9ad91b13fd70e5aa1e0 (diff)
downloadbcm5719-llvm-9930bd8c4f778145c97a8baa2e6d0311cfa89e2e.tar.gz
bcm5719-llvm-9930bd8c4f778145c97a8baa2e6d0311cfa89e2e.zip
Be less promiscuous with generating summaries for "new", "copy", "create".
llvm-svn: 50798
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index 8e26b679e84..72c5e0ab603 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -492,7 +492,6 @@ static bool isCFRefType(QualType T) {
return true;
}
-#if 0
static bool isNSType(QualType T) {
if (!T->isPointerType())
@@ -513,8 +512,6 @@ static bool isNSType(QualType T) {
return true;
}
-#endif
-
RetainSummary* RetainSummaryManager::getCFSummaryCreateRule(FunctionDecl* FD) {
@@ -606,6 +603,9 @@ RetainSummaryManager::getMethodSummary(ObjCMessageExpr* ME) {
// "copyXXX", "createXXX", "newXXX": allocators.
+ if (!isNSType(ME->getReceiver()->getType()))
+ return 0;
+
if (strcasestr(s, "create") == 0 || strcasestr(s, "copy") == 0 ||
strcasestr(s, "new") == 0) {
OpenPOWER on IntegriCloud