summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-05 22:11:14 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-05 22:11:14 +0000
commit5f968930d71b718b3df6b17dec75149beed60476 (patch)
tree523f0fb2a07dba2afc0b3535d034f06df7105c51 /clang/lib/Analysis/CFRefCount.cpp
parentc719d73eecee175164356acc4ac5fd9dc1cdc356 (diff)
downloadbcm5719-llvm-5f968930d71b718b3df6b17dec75149beed60476.tar.gz
bcm5719-llvm-5f968930d71b718b3df6b17dec75149beed60476.zip
Minor tweak: Recognize 'CGCF' prefix in addition to 'CF' and 'CG'.
llvm-svn: 66208
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index 8c3d9bf366f..6caea59f3e4 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -849,6 +849,10 @@ RetainSummary* RetainSummaryManager::getSummary(FunctionDecl* FD) {
const FunctionType* FT = FD->getType()->getAsFunctionType();
const char* FName = FD->getIdentifier()->getName();
+ // Strip away preceding '_'. Doing this here will effect all the checks
+ // down below.
+ while (*FName == '_') ++FName;
+
// Inspect the result type.
QualType RetTy = FT->getResultType();
@@ -910,7 +914,13 @@ RetainSummary* RetainSummaryManager::getSummary(FunctionDecl* FD) {
// Check for release functions, the only kind of functions that we care
// about that don't return a pointer type.
if (FName[0] == 'C' && (FName[1] == 'F' || FName[1] == 'G')) {
- if (isRelease(FD, FName+2))
+ // Test for 'CGCF'.
+ if (FName[1] == 'G' && FName[2] == 'C' && FName[3] == 'F')
+ FName += 4;
+ else
+ FName += 2;
+
+ if (isRelease(FD, FName))
S = getUnarySummary(FT, cfrelease);
else {
assert (ScratchArgs.empty());
OpenPOWER on IntegriCloud