diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-06 16:00:34 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-06 16:00:34 +0000 |
commit | 786dcd9dca76e3780fdb9642c0db33ed13db1187 (patch) | |
tree | d883d215b8bef1a3d643dcc59778122d7685b5e2 /lib/Analysis/CocoaConventions.cpp | |
parent | 19f74acdf8842ceece578b7307884f5ba22d7f59 (diff) |
Teach the static analyzer's interpretation of Cocoa conventions to
obey the objc_method_family attribute when provided. Fixes
<rdar://problem/9726279>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134493 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CocoaConventions.cpp')
-rw-r--r-- | lib/Analysis/CocoaConventions.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/CocoaConventions.cpp b/lib/Analysis/CocoaConventions.cpp index f9cbe12ebc..9068ca3949 100644 --- a/lib/Analysis/CocoaConventions.cpp +++ b/lib/Analysis/CocoaConventions.cpp @@ -36,8 +36,10 @@ using llvm::StringRef; // not release it." // -cocoa::NamingConvention cocoa::deriveNamingConvention(Selector S) { - switch (S.getMethodFamily()) { +cocoa::NamingConvention cocoa::deriveNamingConvention(Selector S, + const ObjCMethodDecl *MD) { + switch (MD && MD->hasAttr<ObjCMethodFamilyAttr>()? MD->getMethodFamily() + : S.getMethodFamily()) { case OMF_None: case OMF_autorelease: case OMF_dealloc: |