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);
102 if (!ident)
return false;
103 StringRef functionName = ident->
getName();
105 StringRef::iterator it = functionName.begin();
106 StringRef::iterator start = it;
107 StringRef::iterator endI = functionName.end();
111 for ( ; it != endI ; ++it) {
114 if (ch ==
'C' || ch ==
'c') {
116 if (ch ==
'c' && it != start &&
isLetter(*(it - 1)))
130 StringRef suffix = functionName.substr(it - start);
131 if (suffix.startswith(
"reate")) {
134 else if (suffix.startswith(
"opy")) {
bool hasDefinition() const
Determine whether this class has been defined.
An instance of this class is created to represent a function declaration or definition.
bool isObjCQualifiedIdType() const
True if this is equivalent to 'id.
PointerType - C99 6.7.5.1 - Pointer Declarators.
QualType getPointeeType() const
A (possibly-)qualified type.
C Language Family Type Representation.
bool isCocoaObjectRef(QualType T)
const T * getAs() const
Member-template getAs<specific type>'.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
One of these records is kept for each identifier that is lexed.
LLVM_READONLY bool isLetter(unsigned char c)
Return true if this character is an ASCII letter: [a-zA-Z].
bool followsCreateRule(const FunctionDecl *FD)
Represents an ObjC class declaration.
const FunctionProtoType * T
bool isObjCIdType() const
True if this is equivalent to the 'id' type, i.e.
ObjCInterfaceDecl * getSuperClass() const
bool isCFObjectRef(QualType T)
bool isObjCQualifiedClassType() const
True if this is equivalent to 'Class.
bool isObjCObjectPointerType() const
LLVM_READONLY bool isLowercase(unsigned char c)
Return true if this character is a lowercase ASCII letter: [a-z].
StringRef getName() const
Return the actual identifier string.
Dataflow Directional Tag Classes.
bool isRefType(QualType RetTy, StringRef Prefix, StringRef Name=StringRef())
bool isObjCClassType() const
True if this is equivalent to the 'Class' type, i.e.
Represents a pointer to an Objective C object.
static bool isDiskArbitrationAPIRefType(QualType T)
Returns true when the passed-in type is a CF-style reference-counted type from the DiskArbitration fr...
ObjCInterfaceDecl * getInterfaceDecl() const
If this pointer points to an Objective @interface type, gets the declaration for that interface...
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.