clang API Documentation
#include <Type.h>
Public Types | |
typedef ObjCObjectType::qual_iterator | qual_iterator |
typedef llvm::iterator_range < qual_iterator > | qual_range |
Public Member Functions | |
QualType | getPointeeType () const |
const ObjCObjectType * | getObjectType () const |
const ObjCInterfaceType * | getInterfaceType () const |
ObjCInterfaceDecl * | getInterfaceDecl () const |
bool | isObjCIdType () const |
bool | isObjCClassType () const |
bool | isObjCQualifiedIdType () const |
bool | isObjCQualifiedClassType () const |
qual_range | quals () const |
qual_iterator | qual_begin () const |
qual_iterator | qual_end () const |
bool | qual_empty () const |
unsigned | getNumProtocols () const |
ObjCProtocolDecl * | getProtocol (unsigned I) const |
Retrieve a qualifying protocol by index on the object type. | |
bool | isSugared () const |
QualType | desugar () const |
void | Profile (llvm::FoldingSetNodeID &ID) |
Static Public Member Functions | |
static void | Profile (llvm::FoldingSetNodeID &ID, QualType T) |
static bool | classof (const Type *T) |
Friends | |
class | ASTContext |
ObjCObjectPointerType - Used to represent a pointer to an Objective C object. These are constructed from pointer declarators when the pointee type is an ObjCObjectType (or sugar for one). In addition, the 'id' and 'Class' types are typedefs for these, and the protocol-qualified types 'id
' and 'Class
' are translated into these.
Pointers to pointers to Objective C objects are still PointerTypes; only the first level of pointer gets it own type implementation.
typedef llvm::iterator_range<qual_iterator> clang::ObjCObjectPointerType::qual_range |
static bool clang::ObjCObjectPointerType::classof | ( | const Type * | T | ) | [inline, static] |
Definition at line 4609 of file Type.h.
References clang::Type::getTypeClass().
QualType clang::ObjCObjectPointerType::desugar | ( | ) | const [inline] |
ObjCInterfaceDecl* clang::ObjCObjectPointerType::getInterfaceDecl | ( | ) | const [inline] |
getInterfaceDecl - If this pointer points to an Objective @interface type, gets the declaration for that interface.
Definition at line 4545 of file Type.h.
Referenced by clang::Sema::CheckMessageArgumentTypes(), clang::Sema::CodeCompleteMemberReferenceExpr(), clang::Sema::ConversionToObjCStringLiteralCheck(), clang::ObjCMethodCall::getRuntimeDefinition(), clang::ento::cocoa::isCocoaObjectRef(), isKnownNonNilCollectionType(), IsNSError(), isObjCPtrBlockCompatible(), and clang::ASTContext::ObjCQualifiedIdTypesAreCompatible().
const ObjCInterfaceType* clang::ObjCObjectPointerType::getInterfaceType | ( | ) | const [inline] |
getInterfaceType - If this pointer points to an Objective C @interface type, gets the type for that interface. Any protocol qualifiers on the interface are ignored.
Definition at line 4537 of file Type.h.
References clang::Type::getAs(), and clang::ObjCObjectType::getBaseType().
Referenced by clang::ASTContext::canAssignObjCInterfacesInBlockPointer(), clang::Sema::DiagnoseAssignmentResult(), clang::Sema::HandleExprPropertyRefExpr(), and clang::Sema::isObjCPointerConversion().
unsigned clang::ObjCObjectPointerType::getNumProtocols | ( | ) | const [inline] |
const ObjCObjectType* clang::ObjCObjectPointerType::getObjectType | ( | ) | const [inline] |
getObjCObjectType - Gets the type pointed to by this ObjC pointer. This method always returns non-null.
This method is equivalent to getPointeeType() except that it discards any typedefs (or other sugar) between this type and the "outermost" object type. So for:
\@class A; \@protocol P; \@protocol Q; typedef A<P> AP; typedef A A1; typedef A1<P> A1P; typedef A1P<Q> A1PQ;
For 'A*', getObjectType() will return 'A'. For 'A
*', getObjectType() will return 'A
'. For 'AP*', getObjectType() will return 'A
'. For 'A1*', getObjectType() will return 'A'. For 'A1
*', getObjectType() will return 'A1
'. For 'A1P*', getObjectType() will return 'A1
'. For 'A1PQ*', getObjectType() will return 'A1<Q>', because adding protocols to a protocol-qualified base discards the old qualifiers (for now). But if it didn't, getObjectType() would return 'A1P<Q>' (and we'd have to make iterating over qualifiers more complicated).
Definition at line 4528 of file Type.h.
References clang::Type::castAs().
Referenced by clang::ASTContext::areCommonBaseCompatible(), clang::ASTContext::canAssignObjCInterfaces(), clang::Sema::CheckObjCForCollectionOperand(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), getIntersectionOfProtocols(), isNSStringType(), LookupMemberExpr(), and ShouldTryAgainWithRedefinitionType().
QualType clang::ObjCObjectPointerType::getPointeeType | ( | ) | const [inline] |
getPointeeType - Gets the type pointed to by this ObjC pointer. The result will always be an ObjCObjectType or sugar thereof.
Reimplemented from clang::Type.
Definition at line 4502 of file Type.h.
Referenced by DiagnoseBadConversion(), clang::Sema::HandleExprPropertyRefExpr(), hasIsEqualMethod(), clang::Sema::isObjCPointerConversion(), IsStructurallyEquivalent(), LookupMethodInReceiverType(), clang::CodeGen::CodeGenFunction::TypeOfSelfObject(), UnwrapDissimilarPointerTypes(), clang::ASTContext::UnwrapSimilarPointerTypes(), and clang::ASTNodeImporter::VisitObjCObjectPointerType().
ObjCProtocolDecl* clang::ObjCObjectPointerType::getProtocol | ( | unsigned | I | ) | const [inline] |
bool clang::ObjCObjectPointerType::isObjCClassType | ( | ) | const [inline] |
isObjCClassType - True if this is equivalent to the 'Class' type, i.e. if its object tive is the primitive 'Class' type with no protocols.
Reimplemented from clang::Type.
Definition at line 4557 of file Type.h.
Referenced by CompareDerivedToBaseConversions(), clang::ento::cocoa::isCocoaObjectRef(), and LookupMethodInReceiverType().
bool clang::ObjCObjectPointerType::isObjCIdType | ( | ) | const [inline] |
isObjCIdType - True if this is equivalent to the 'id' type, i.e. if its object type is the primitive 'id' type with no protocols.
Reimplemented from clang::Type.
Definition at line 4551 of file Type.h.
Referenced by clang::ASTContext::canAssignObjCInterfacesInBlockPointer(), CompareDerivedToBaseConversions(), clang::Sema::ConversionToObjCStringLiteralCheck(), hasIsEqualMethod(), clang::ento::cocoa::isCocoaObjectRef(), and isObjCTypeSubstitutable().
bool clang::ObjCObjectPointerType::isObjCQualifiedClassType | ( | ) | const [inline] |
isObjCQualifiedClassType - True if this is equivalent to 'Class
' for some non-empty set of protocols.
Reimplemented from clang::Type.
Definition at line 4569 of file Type.h.
Referenced by clang::ento::cocoa::isCocoaObjectRef().
bool clang::ObjCObjectPointerType::isObjCQualifiedIdType | ( | ) | const [inline] |
isObjCQualifiedIdType - True if this is equivalent to 'id
' for some non-empty set of protocols.
Reimplemented from clang::Type.
Definition at line 4563 of file Type.h.
Referenced by clang::ASTContext::canAssignObjCInterfacesInBlockPointer(), clang::ento::cocoa::isCocoaObjectRef(), clang::Sema::isObjCPointerConversion(), and isObjCTypeSubstitutable().
bool clang::ObjCObjectPointerType::isSugared | ( | ) | const [inline] |
void clang::ObjCObjectPointerType::Profile | ( | llvm::FoldingSetNodeID & | ID | ) | [inline] |
Definition at line 4603 of file Type.h.
Referenced by clang::ASTContext::getObjCObjectPointerType().
static void clang::ObjCObjectPointerType::Profile | ( | llvm::FoldingSetNodeID & | ID, |
QualType | T | ||
) | [inline, static] |
Definition at line 4606 of file Type.h.
References clang::QualType::getAsOpaquePtr().
qual_iterator clang::ObjCObjectPointerType::qual_begin | ( | ) | const [inline] |
bool clang::ObjCObjectPointerType::qual_empty | ( | ) | const [inline] |
Definition at line 4586 of file Type.h.
Referenced by clang::ASTContext::ObjCQualifiedIdTypesAreCompatible().
qual_iterator clang::ObjCObjectPointerType::qual_end | ( | ) | const [inline] |
qual_range clang::ObjCObjectPointerType::quals | ( | ) | const [inline] |
Definition at line 4579 of file Type.h.
Referenced by clang::Sema::CodeCompleteMemberReferenceExpr(), clang::Sema::DiagnoseAssignmentResult(), FindGetterSetterNameDecl(), clang::Sema::HandleExprPropertyRefExpr(), isObjCPtrBlockCompatible(), clang::Sema::LookupMethodInQualifiedType(), clang::ASTContext::ObjCQualifiedClassTypesAreCompatible(), clang::ASTContext::ObjCQualifiedIdTypesAreCompatible(), and clang::ASTContext::QIdProtocolsAdoptObjCObjectProtocols().
friend class ASTContext [friend] |
Reimplemented from clang::Type.