From 24b1d9f57e47f08b63beb28781c50017c544cc3e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 4 Nov 2008 00:36:12 +0000 Subject: [PATCH] Handle prefix '_' that may appear in front of the name of 'Release' functions llvm-svn: 58666 --- clang/lib/Analysis/CFRefCount.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 25466cbf6229..80c6bf953247 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/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);