]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - contrib/llvm/tools/clang/include/clang/Analysis/DomainSpecific/CocoaConventions.h
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.git] / contrib / llvm / tools / clang / include / clang / Analysis / DomainSpecific / CocoaConventions.h
1 //===- CocoaConventions.h - Special handling of Cocoa conventions -*- C++ -*--//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements cocoa naming convention analysis. 
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CLANG_ANALYSIS_DS_COCOA
15 #define LLVM_CLANG_ANALYSIS_DS_COCOA
16
17 #include "clang/Basic/IdentifierTable.h"
18 #include "llvm/ADT/StringRef.h"
19
20 namespace clang {
21 class FunctionDecl;
22 class ObjCMethodDecl;
23 class QualType;
24   
25 namespace ento {
26 namespace cocoa {
27  
28   enum NamingConvention { NoConvention, CreateRule, InitRule };
29
30   NamingConvention deriveNamingConvention(Selector S, const ObjCMethodDecl *MD);
31
32   static inline bool followsFundamentalRule(Selector S, 
33                                             const ObjCMethodDecl *MD) {
34     return deriveNamingConvention(S, MD) == CreateRule;
35   }
36   
37   bool isRefType(QualType RetTy, StringRef Prefix,
38                  StringRef Name = StringRef());
39     
40   bool isCocoaObjectRef(QualType T);
41
42 }
43
44 namespace coreFoundation {
45   bool isCFObjectRef(QualType T);
46   
47   bool followsCreateRule(const FunctionDecl *FD);
48 }
49
50 }} // end: "clang:ento"
51
52 #endif