[cfe-commits] r50798 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Ted Kremenek kremenek at apple.com
Tue May 6 21:25:59 PDT 2008


Author: kremenek
Date: Tue May  6 23:25:59 2008
New Revision: 50798

URL: http://llvm.org/viewvc/llvm-project?rev=50798&view=rev
Log:
Be less promiscuous with generating summaries for "new", "copy", "create".

Modified:
    cfe/trunk/lib/Analysis/CFRefCount.cpp

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=50798&r1=50797&r2=50798&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue May  6 23:25:59 2008
@@ -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) {
     





More information about the cfe-commits mailing list