1 //===- CocoaConventions.h - Special handling of Cocoa conventions -*- C++ -*--//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements cocoa naming convention analysis.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_ANALYSIS_DS_COCOA
15 #define LLVM_CLANG_ANALYSIS_DS_COCOA
17 #include "clang/Basic/IdentifierTable.h"
18 #include "llvm/ADT/StringRef.h"
28 enum NamingConvention { NoConvention, CreateRule, InitRule };
30 NamingConvention deriveNamingConvention(Selector S, const ObjCMethodDecl *MD);
32 static inline bool followsFundamentalRule(Selector S,
33 const ObjCMethodDecl *MD) {
34 return deriveNamingConvention(S, MD) == CreateRule;
37 bool isRefType(QualType RetTy, StringRef Prefix,
38 StringRef Name = StringRef());
40 bool isCocoaObjectRef(QualType T);
44 namespace coreFoundation {
45 bool isCFObjectRef(QualType T);
47 bool followsCreateRule(const FunctionDecl *FD);
50 }} // end: "clang:ento"