From: Ted Kremenek Date: Tue, 4 Nov 2008 00:36:12 +0000 (+0000) Subject: Handle prefix '_' that may appear in front of the name of 'Release' functions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ca31916ac3d03ec0b3b2acb3c8f775f19929605;p=clang Handle prefix '_' that may appear in front of the name of 'Release' functions git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58666 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 25466cbf62..80c6bf9532 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -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);