19 #include "llvm/ADT/StringExtras.h"
20 #include "llvm/Support/ErrorHandling.h"
22 using namespace clang;
29 StringRef TDName = TD->getDecl()->getIdentifier()->getName();
30 if (TDName.startswith(Prefix) && TDName.endswith(
"Ref"))
33 if (TDName.startswith(
"xpc_"))
35 RetTy = TD->getDecl()->getUnderlyingType();
47 return Name.startswith(Prefix);
95 if (!ident)
return false;
96 StringRef functionName = ident->
getName();
98 StringRef::iterator it = functionName.begin();
99 StringRef::iterator start = it;
100 StringRef::iterator endI = functionName.end();
104 for ( ; it != endI ; ++it) {
107 if (ch ==
'C' || ch ==
'c') {
109 if (ch ==
'c' && it != start &&
isLetter(*(it - 1)))
123 StringRef suffix = functionName.substr(it - start);
124 if (suffix.startswith(
"reate")) {
127 else if (suffix.startswith(
"opy")) {
bool hasDefinition() const
Determine whether this class has been defined.
IdentifierInfo * getIdentifier() const
static LLVM_READONLY bool isLetter(unsigned char c)
Return true if this character is an ASCII letter: [a-zA-Z].
bool isCocoaObjectRef(QualType T)
bool followsCreateRule(const FunctionDecl *FD)
Represents an ObjC class declaration.
ID
Defines the set of possible language-specific address spaces.
StringRef getName() const
Return the actual identifier string.
bool isObjCQualifiedIdType() const
bool isCFObjectRef(QualType T)
bool isObjCQualifiedClassType() const
QualType getPointeeType() const
bool isRefType(QualType RetTy, StringRef Prefix, StringRef Name=StringRef())
static LLVM_READONLY bool isLowercase(unsigned char c)
Return true if this character is a lowercase ASCII letter: [a-z].
ObjCInterfaceDecl * getInterfaceDecl() const
bool isObjCClassType() const
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
bool isObjCObjectPointerType() const
ObjCInterfaceDecl * getSuperClass() const
bool isObjCIdType() const