summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CocoaConventions.cpp
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2012-03-17 20:51:32 +0000
committerJordy Rose <jediknil@belkadan.com>2012-03-17 20:51:32 +0000
commit9046bcd03b4e8ceb68581b5df2660d3999ade9d3 (patch)
tree4e8970ba5b8ecf5899c186914a63eb0793d3ecc0 /clang/lib/Analysis/CocoaConventions.cpp
parent5d1bca8016659d5fcff22d2b0f2f6131228e9c7a (diff)
downloadbcm5719-llvm-9046bcd03b4e8ceb68581b5df2660d3999ade9d3.tar.gz
bcm5719-llvm-9046bcd03b4e8ceb68581b5df2660d3999ade9d3.zip
Kill cocoa::deriveNamingConvention and cocoa::followsFundamentalRule. They are now just simple wrappers around method families, and method decls can cache method family lookups. Also, no one is using them right now.
The one difference between ObjCMethodDecl::getMethodFamily and Selector::getMethodFamily is that the former will do some additional sanity checking, and since CoreFoundation types don't look like Objective-C objects, an otherwise interesting method will get a method family of OMF_None. Future clients that use method families should consider how they want to handle CF types. llvm-svn: 153000
Diffstat (limited to 'clang/lib/Analysis/CocoaConventions.cpp')
-rw-r--r--clang/lib/Analysis/CocoaConventions.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/clang/lib/Analysis/CocoaConventions.cpp b/clang/lib/Analysis/CocoaConventions.cpp
index ee8a6efb358..7e9e38fd1ea 100644
--- a/clang/lib/Analysis/CocoaConventions.cpp
+++ b/clang/lib/Analysis/CocoaConventions.cpp
@@ -20,46 +20,6 @@
using namespace clang;
using namespace ento;
-// The "fundamental rule" for naming conventions of methods:
-// (url broken into two lines)
-// http://developer.apple.com/documentation/Cocoa/Conceptual/
-// MemoryMgmt/Tasks/MemoryManagementRules.html
-//
-// "You take ownership of an object if you create it using a method whose name
-// begins with "alloc" or "new" or contains "copy" (for example, alloc,
-// newObject, or mutableCopy), or if you send it a retain message. You are
-// responsible for relinquishing ownership of objects you own using release
-// or autorelease. Any other time you receive an object, you must
-// not release it."
-//
-
-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:
- case OMF_finalize:
- case OMF_release:
- case OMF_retain:
- case OMF_retainCount:
- case OMF_self:
- case OMF_performSelector:
- return NoConvention;
-
- case OMF_init:
- return InitRule;
-
- case OMF_alloc:
- case OMF_copy:
- case OMF_mutableCopy:
- case OMF_new:
- return CreateRule;
- }
- llvm_unreachable("unexpected naming convention");
-}
-
bool cocoa::isRefType(QualType RetTy, StringRef Prefix,
StringRef Name) {
// Recursively walk the typedef stack, allowing typedefs of reference types.
OpenPOWER on IntegriCloud