CocoaConventions.h revision 6970155edde8c79cf22824322470485434b8eb83
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/AST/Type.h" 18 19namespace clang { 20namespace ento { 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