CocoaConventions.h revision 5a4f98ff943e6a501b0fe47ade007c9bbf96cb88
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 defines
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_ANALYSIS_DS_COCOA
15#define LLVM_CLANG_ANALYSIS_DS_COCOA
16
17#include "clang/AST/Type.h"
18
19namespace clang {
20namespace GR {
21namespace cocoa {
22
23  enum NamingConvention { NoConvention, CreateRule, InitRule };
24
25  NamingConvention deriveNamingConvention(Selector S);
26
27  static inline bool followsFundamentalRule(Selector S) {
28    return deriveNamingConvention(S) == CreateRule;
29  }
30
31  bool isRefType(QualType RetTy, llvm::StringRef Prefix,
32                 llvm::StringRef Name = llvm::StringRef());
33
34  bool isCFObjectRef(QualType T);
35
36  bool isCocoaObjectRef(QualType T);
37
38}}}
39
40#endif
41