]> granicus.if.org Git - clang/commitdiff
Extend "followsFundamentalRule" to ignore prefix '_' characters.
authorTed Kremenek <kremenek@apple.com>
Thu, 30 Oct 2008 23:14:58 +0000 (23:14 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 30 Oct 2008 23:14:58 +0000 (23:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58469 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFRefCount.cpp

index fe7a1989704f57838441008a5a584f9fb906f56b..87a6b38b8719c3b686031c1a1765f012ce54aa46 100644 (file)
@@ -54,6 +54,7 @@ using llvm::CStrInCStrNoCase;
 //  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 @@ RetainSummary* RetainSummaryManager::getSummary(FunctionDecl* FD) {
 
   // No summary.  Generate one.
   const char* FName = FD->getIdentifier()->getName();
-    
-  RetainSummary *S = 0;
   
+  RetainSummary *S = 0;  
   FunctionType* FT = dyn_cast<FunctionType>(FD->getType());
 
   do {