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

Ted Kremenek kremenek at apple.com
Thu Oct 30 16:14:59 PDT 2008


Author: kremenek
Date: Thu Oct 30 18:14:58 2008
New Revision: 58469

URL: http://llvm.org/viewvc/llvm-project?rev=58469&view=rev
Log:
Extend "followsFundamentalRule" to ignore prefix '_' characters.

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=58469&r1=58468&r2=58469&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Thu Oct 30 18:14:58 2008
@@ -54,6 +54,7 @@
 //  not release it."
 //
 static bool followsFundamentalRule(const char* s) {
+  while (*s == '_') ++s;  
   return CStrInCStrNoCase(s, "create") || CStrInCStrNoCase(s, "copy")  || 
   CStrInCStrNoCase(s, "new") == s || CStrInCStrNoCase(s, "alloc") == s;
 }  
@@ -709,9 +710,8 @@
 
   // No summary.  Generate one.
   const char* FName = FD->getIdentifier()->getName();
-    
-  RetainSummary *S = 0;
   
+  RetainSummary *S = 0;  
   FunctionType* FT = dyn_cast<FunctionType>(FD->getType());
 
   do {





More information about the cfe-commits mailing list