]> granicus.if.org Git - clang/commitdiff
Be less promiscuous with generating summaries for "new", "copy", "create".
authorTed Kremenek <kremenek@apple.com>
Wed, 7 May 2008 04:25:59 +0000 (04:25 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 7 May 2008 04:25:59 +0000 (04:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50798 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFRefCount.cpp

index 8e26b679e849c85b1b78577e87f633e27977dcff..72c5e0ab603f0590193b4a1cb8b7cca2fbf78183 100644 (file)
@@ -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) {