blob: fa8afccfcd895576bc789a923eef98e103582626 (
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
41
42
43
44
45
46
47
48
49
50
51
52
|
//===- 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 implements cocoa naming convention analysis.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_ANALYSIS_DS_COCOA
#define LLVM_CLANG_ANALYSIS_DS_COCOA
#include "clang/Basic/IdentifierTable.h"
#include "llvm/ADT/StringRef.h"
namespace clang {
class FunctionDecl;
class ObjCMethodDecl;
class QualType;
namespace ento {
namespace cocoa {
enum NamingConvention { NoConvention, CreateRule, InitRule };
NamingConvention deriveNamingConvention(Selector S, const ObjCMethodDecl *MD);
static inline bool followsFundamentalRule(Selector S,
const ObjCMethodDecl *MD) {
return deriveNamingConvention(S, MD) == CreateRule;
}
bool isRefType(QualType RetTy, StringRef Prefix,
StringRef Name = StringRef());
bool isCocoaObjectRef(QualType T);
}
namespace coreFoundation {
bool isCFObjectRef(QualType T);
bool followsCreateRule(const FunctionDecl *FD);
}
}} // end: "clang:ento"
#endif
|