summaryrefslogtreecommitdiffstats
path: root/include/clang/Checker/DomainSpecific/CocoaConventions.h
blob: ee3d648b86081b2c828a12eb3b6c69d4a744aa6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//===- CocoaConventions.h - Special handling of Cocoa conventions -*- C++ -*--//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines 
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_CHECKER_DS_COCOA
#define LLVM_CLANG_CHECKER_DS_COCOA

#include "clang/Basic/IdentifierTable.h"
#include "clang/AST/Type.h"

namespace clang {
namespace cocoa {
 
  enum NamingConvention { NoConvention, CreateRule, InitRule };

  NamingConvention deriveNamingConvention(Selector S);

  static inline bool followsFundamentalRule(Selector S) {
    return deriveNamingConvention(S) == CreateRule;
  }
  
  bool isRefType(QualType RetTy, llvm::StringRef Prefix,
                 llvm::StringRef Name = llvm::StringRef());
  
  bool isCFObjectRef(QualType T);
  
  bool isCocoaObjectRef(QualType T);

}}

#endif
OpenPOWER on IntegriCloud