]> granicus.if.org Git - clang/commitdiff
Handle prefix '_' that may appear in front of the name of 'Release' functions
authorTed Kremenek <kremenek@apple.com>
Tue, 4 Nov 2008 00:36:12 +0000 (00:36 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 4 Nov 2008 00:36:12 +0000 (00:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58666 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFRefCount.cpp

index 25466cbf6229ee8522f318d5c289df62b071c493..80c6bf9532473163346794ce0a23ac78564d0a45 100644 (file)
@@ -741,6 +741,9 @@ RetainSummary* RetainSummaryManager::getSummary(FunctionDecl* FD) {
         break;
       }
     }
+    
+    // Ignore the prefix '_'
+    while (*FName == '_') ++FName;
 
     if (FName[0] == 'C') {
       if (FName[1] == 'F')
@@ -780,9 +783,6 @@ static bool isRelease(FunctionDecl* FD, const char* FName) {
 RetainSummary* RetainSummaryManager::getCFSummary(FunctionDecl* FD,
                                                   const char* FName) {
 
-  if (FName[0] == 'C' && FName[1] == 'F')
-    FName += 2;
-
   if (isRetain(FD, FName))
     return getUnarySummary(FD, cfretain);
   
@@ -798,9 +798,6 @@ RetainSummary* RetainSummaryManager::getCFSummary(FunctionDecl* FD,
 RetainSummary* RetainSummaryManager::getCGSummary(FunctionDecl* FD,
                                                   const char* FName) {
   
-  if (FName[0] == 'C' && FName[1] == 'G')
-    FName += 2;
-  
   if (isRelease(FD, FName))
     return getUnarySummary(FD, cfrelease);