aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-13 20:27:06 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-13 20:27:06 +0000
commit8be2a67620b6be5f2c15dc44099e71b2c8e59ef7 (patch)
tree8a4f06345135d501c3cb9ecb56447b26c9230a38 /lib/Analysis/CFRefCount.cpp
parent9d25423797de98f4e286fd681a6bbe5b48b0493a (diff)
Fix PR 3677 [retain checker]: custom 'allocWithZone' methods should be allowed
to return an owning pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 75a9f3dca1..b6c11c9cfc 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -119,12 +119,15 @@ static NamingConvention deriveNamingConvention(const char* s) {
case 4:
// Methods starting with 'alloc' or contain 'copy' follow the
// create rule
- if ((AtBeginning && StringsEqualNoCase("alloc", s, len)) ||
- (C == NoConvention && StringsEqualNoCase("copy", s, len)))
+ if (C == NoConvention && StringsEqualNoCase("copy", s, len))
C = CreateRule;
else // Methods starting with 'init' follow the init rule.
if (AtBeginning && StringsEqualNoCase("init", s, len))
- C = InitRule;
+ C = InitRule;
+ break;
+ case 5:
+ if (AtBeginning && StringsEqualNoCase("alloc", s, len))
+ C = CreateRule;
break;
}