Be less promiscuous with generating summaries for "new", "copy", "create".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50798 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 8e26b67..72c5e0a 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -492,7 +492,6 @@
   return true;
 }
 
-#if 0
 static bool isNSType(QualType T) {
   
   if (!T->isPointerType())
@@ -513,8 +512,6 @@
   
   return true;
 }
-#endif
-
 
 RetainSummary* RetainSummaryManager::getCFSummaryCreateRule(FunctionDecl* FD) {
  
@@ -606,6 +603,9 @@
   
   // "copyXXX", "createXXX", "newXXX": allocators.  
 
+  if (!isNSType(ME->getReceiver()->getType()))
+    return 0;
+  
   if (strcasestr(s, "create") == 0 || strcasestr(s, "copy") == 0 || 
       strcasestr(s, "new") == 0) {