[cfe-commits] r66208 - /cfe/trunk/lib/Analysis/CFRefCount.cpp
Ted Kremenek
kremenek at apple.com
Thu Mar 5 14:11:18 PST 2009
Author: kremenek
Date: Thu Mar 5 16:11:14 2009
New Revision: 66208
URL: http://llvm.org/viewvc/llvm-project?rev=66208&view=rev
Log:
Minor tweak: Recognize 'CGCF' prefix in addition to 'CF' and 'CG'.
Modified:
cfe/trunk/lib/Analysis/CFRefCount.cpp
Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=66208&r1=66207&r2=66208&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Thu Mar 5 16:11:14 2009
@@ -849,6 +849,10 @@
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 @@
// 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());
More information about the cfe-commits
mailing list