clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Friends
clang::ObjCObjectPointerType Class Reference

#include <Type.h>

Inheritance diagram for clang::ObjCObjectPointerType:
Inheritance graph
[legend]
Collaboration diagram for clang::ObjCObjectPointerType:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
ObjCObjectType::qual_iterator 
qual_iterator
typedef llvm::iterator_range
< qual_iterator
qual_range

Public Member Functions

QualType getPointeeType () const
const ObjCObjectTypegetObjectType () const
const ObjCInterfaceTypegetInterfaceType () const
ObjCInterfaceDeclgetInterfaceDecl () 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
ObjCProtocolDeclgetProtocol (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

Detailed Description

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.

Definition at line 4491 of file Type.h.


Member Typedef Documentation

An iterator over the qualifiers on the object type. Provided for convenience. This will always iterate over the full set of protocols on a type, not just those provided directly.

Definition at line 4576 of file Type.h.

Definition at line 4577 of file Type.h.


Member Function Documentation

static bool clang::ObjCObjectPointerType::classof ( const Type T) [inline, static]

Definition at line 4609 of file Type.h.

References clang::Type::getTypeClass().

Definition at line 4601 of file Type.h.

getInterfaceDecl - If this pointer points to an Objective @interface type, gets the declaration for that interface.

Returns:
null if the base type for this pointer is 'id' or 'Class'

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().

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.

Returns:
null if the base type for this pointer is 'id' or 'Class'

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().

getNumProtocols - Return the number of qualifying protocols on the object type.

Definition at line 4590 of file Type.h.

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().

Retrieve a qualifying protocol by index on the object type.

Definition at line 4596 of file Type.h.

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().

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().

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().

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().

Definition at line 4600 of file Type.h.

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().

Definition at line 4580 of file Type.h.

Definition at line 4586 of file Type.h.

Referenced by clang::ASTContext::ObjCQualifiedIdTypesAreCompatible().

Definition at line 4583 of file Type.h.


Friends And Related Function Documentation

friend class ASTContext [friend]

Reimplemented from clang::Type.

Definition at line 4497 of file Type.h.


The documentation for this class was generated from the following file: