CocoaConventions.h revision bb8fef382ad89b4bc202a1dbd4cd52ced7734479
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 cocoa {
21
22  enum NamingConvention { NoConvention, CreateRule, InitRule };
23
24  NamingConvention deriveNamingConvention(Selector S);
25
26  static inline bool followsFundamentalRule(Selector S) {
27    return deriveNamingConvention(S) == CreateRule;
28  }
29
30  bool isRefType(QualType RetTy, llvm::StringRef Prefix,
31                 llvm::StringRef Name = llvm::StringRef());
32
33  bool isCFObjectRef(QualType T);
34
35  bool isCocoaObjectRef(QualType T);
36
37}}
38
39#endif
40