clang  3.7.0
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::ObjCObjectPointerType Class Reference

#include <Type.h>

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

Public Types

typedef
ObjCObjectType::qual_iterator 
qual_iterator
 
typedef llvm::iterator_range
< qual_iterator
qual_range
 
- Public Types inherited from clang::Type
enum  TypeClass { TagFirst = Record, TagLast = Enum }
 
enum  ScalarTypeKind {
  STK_CPointer, STK_BlockPointer, STK_ObjCObjectPointer, STK_MemberPointer,
  STK_Bool, STK_Integral, STK_Floating, STK_IntegralComplex,
  STK_FloatingComplex
}
 

Public Member Functions

QualType getPointeeType () const
 
const ObjCObjectTypegetObjectType () const
 
const ObjCInterfaceTypegetInterfaceType () const
 
ObjCInterfaceDeclgetInterfaceDecl () const
 
bool isObjCIdType () const
 
bool isObjCClassType () const
 
bool isObjCIdOrClassType () const
 
bool isObjCQualifiedIdType () const
 
bool isObjCQualifiedClassType () const
 
bool isKindOfType () const
 Whether this is a "__kindof" type. More...
 
bool isSpecialized () const
 Whether this type is specialized, meaning that it has type arguments. More...
 
bool isSpecializedAsWritten () const
 Whether this type is specialized, meaning that it has type arguments. More...
 
bool isUnspecialized () const
 Whether this type is unspecialized, meaning that is has no type arguments. More...
 
bool isUnspecializedAsWritten () const
 
ArrayRef< QualTypegetTypeArgs () const
 Retrieve the type arguments for this type. More...
 
ArrayRef< QualTypegetTypeArgsAsWritten () const
 Retrieve the type arguments for this type. More...
 
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. More...
 
bool isSugared () const
 
QualType desugar () const
 
QualType getSuperClassType () const
 
const ObjCObjectPointerTypestripObjCKindOfTypeAndQuals (const ASTContext &ctx) const
 
void Profile (llvm::FoldingSetNodeID &ID)
 
- Public Member Functions inherited from clang::Type
TypeClass getTypeClass () const
 
bool isFromAST () const
 Whether this type comes from an AST file. More...
 
bool containsUnexpandedParameterPack () const
 Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templates. More...
 
bool isCanonicalUnqualified () const
 
QualType getLocallyUnqualifiedSingleStepDesugaredType () const
 
bool isIncompleteType (NamedDecl **Def=nullptr) const
 Def If non-NULL, and the type refers to some kind of declaration that can be completed (such as a C struct, C++ class, or Objective-C class), will be set to the declaration. More...
 
bool isIncompleteOrObjectType () const
 
bool isObjectType () const
 Determine whether this type is an object type. More...
 
bool isLiteralType (const ASTContext &Ctx) const
 
bool isStandardLayoutType () const
 Test if this type is a standard-layout type. (C++0x [basic.type]p9) More...
 
bool isBuiltinType () const
 isBuiltinType - returns true if the type is a builtin type. More...
 
bool isSpecificBuiltinType (unsigned K) const
 isSpecificBuiltinType - Test for a particular builtin type. More...
 
bool isPlaceholderType () const
 
const BuiltinTypegetAsPlaceholderType () const
 
bool isSpecificPlaceholderType (unsigned K) const
 isSpecificPlaceholderType - Test for a specific placeholder type. More...
 
bool isNonOverloadPlaceholderType () const
 
bool isIntegerType () const
 
bool isEnumeralType () const
 
bool isBooleanType () const
 
bool isCharType () const
 
bool isWideCharType () const
 
bool isChar16Type () const
 
bool isChar32Type () const
 
bool isAnyCharacterType () const
 Determine whether this type is any of the built-in character types. More...
 
bool isIntegralType (ASTContext &Ctx) const
 Determine whether this type is an integral type. More...
 
bool isIntegralOrEnumerationType () const
 Determine whether this type is an integral or enumeration type. More...
 
bool isIntegralOrUnscopedEnumerationType () const
 Determine whether this type is an integral or unscoped enumeration type. More...
 
bool isRealFloatingType () const
 Floating point categories. More...
 
bool isComplexType () const
 
bool isAnyComplexType () const
 
bool isFloatingType () const
 
bool isHalfType () const
 
bool isRealType () const
 
bool isArithmeticType () const
 
bool isVoidType () const
 
bool isScalarType () const
 
bool isAggregateType () const
 Determines whether the type is a C++ aggregate type or C aggregate or union type. More...
 
bool isFundamentalType () const
 Tests whether the type is categorized as a fundamental type. More...
 
bool isCompoundType () const
 Tests whether the type is categorized as a compound type. More...
 
bool isFunctionType () const
 
bool isFunctionNoProtoType () const
 
bool isFunctionProtoType () const
 
bool isPointerType () const
 
bool isAnyPointerType () const
 
bool isBlockPointerType () const
 
bool isVoidPointerType () const
 
bool isReferenceType () const
 
bool isLValueReferenceType () const
 
bool isRValueReferenceType () const
 
bool isFunctionPointerType () const
 
bool isMemberPointerType () const
 
bool isMemberFunctionPointerType () const
 
bool isMemberDataPointerType () const
 
bool isArrayType () const
 
bool isConstantArrayType () const
 
bool isIncompleteArrayType () const
 
bool isVariableArrayType () const
 
bool isDependentSizedArrayType () const
 
bool isRecordType () const
 
bool isClassType () const
 
bool isStructureType () const
 
bool isObjCBoxableRecordType () const
 
bool isInterfaceType () const
 
bool isStructureOrClassType () const
 
bool isUnionType () const
 
bool isComplexIntegerType () const
 
bool isVectorType () const
 
bool isExtVectorType () const
 
bool isObjCObjectPointerType () const
 
bool isObjCRetainableType () const
 
bool isObjCLifetimeType () const
 
bool isObjCIndirectLifetimeType () const
 
bool isObjCNSObjectType () const
 
bool isObjCIndependentClassType () const
 
bool isObjCObjectType () const
 
bool isObjCQualifiedInterfaceType () const
 
bool isObjCQualifiedIdType () const
 
bool isObjCQualifiedClassType () const
 
bool isObjCObjectOrInterfaceType () const
 
bool isObjCIdType () const
 
bool isObjCIdOrObjectKindOfType (const ASTContext &ctx, const ObjCObjectType *&bound) const
 
bool isObjCClassType () const
 
bool isObjCClassOrClassKindOfType () const
 
bool isBlockCompatibleObjCPointerType (ASTContext &ctx) const
 
bool isObjCSelType () const
 
bool isObjCBuiltinType () const
 
bool isObjCARCBridgableType () const
 Determine whether the given type T is a "bridgable" Objective-C type, which is either an Objective-C object pointer type or an. More...
 
bool isCARCBridgableType () const
 Determine whether the given type T is a "bridgeable" C type. More...
 
bool isTemplateTypeParmType () const
 
bool isNullPtrType () const
 
bool isAtomicType () const
 
bool isImage1dT () const
 
bool isImage1dArrayT () const
 
bool isImage1dBufferT () const
 
bool isImage2dT () const
 
bool isImage2dArrayT () const
 
bool isImage3dT () const
 
bool isImageType () const
 
bool isSamplerT () const
 
bool isEventT () const
 
bool isOpenCLSpecificType () const
 
bool isObjCARCImplicitlyUnretainedType () const
 
Qualifiers::ObjCLifetime getObjCARCImplicitLifetime () const
 Return the implicit lifetime for this type, which must not be dependent. More...
 
ScalarTypeKind getScalarTypeKind () const
 getScalarTypeKind - Given that this is a scalar type, classify it. More...
 
bool isDependentType () const
 
bool isInstantiationDependentType () const
 Determine whether this type is an instantiation-dependent type, meaning that the type involves a template parameter (even if the definition does not actually depend on the type substituted for that template parameter). More...
 
bool isUndeducedType () const
 Determine whether this type is an undeduced type, meaning that it somehow involves a C++11 'auto' type which has not yet been deduced. More...
 
bool isVariablyModifiedType () const
 Whether this type is a variably-modified type (C99 6.7.5). More...
 
bool hasSizedVLAType () const
 Whether this type involves a variable-length array type with a definite size. More...
 
bool hasUnnamedOrLocalType () const
 Whether this type is or contains a local or unnamed type. More...
 
bool isOverloadableType () const
 Determines whether this is a type for which one can define an overloaded operator. More...
 
bool isElaboratedTypeSpecifier () const
 Determine wither this type is a C++ elaborated-type-specifier. More...
 
bool canDecayToPointerType () const
 Determines whether this type can decay to a pointer type. More...
 
bool hasPointerRepresentation () const
 
bool hasObjCPointerRepresentation () const
 
bool hasIntegerRepresentation () const
 Determine whether this type has an integer representation of some sort, e.g., it is an integer type or a vector. More...
 
bool hasSignedIntegerRepresentation () const
 Determine whether this type has an signed integer representation of some sort, e.g., it is an signed integer type or a vector. More...
 
bool hasUnsignedIntegerRepresentation () const
 Determine whether this type has an unsigned integer representation of some sort, e.g., it is an unsigned integer type or a vector. More...
 
bool hasFloatingRepresentation () const
 Determine whether this type has a floating-point representation of some sort, e.g., it is a floating-point type or a vector thereof. More...
 
const RecordTypegetAsStructureType () const
 
const RecordTypegetAsUnionType () const
 NOTE: getAs*ArrayType are methods on ASTContext. More...
 
const ComplexTypegetAsComplexIntegerType () const
 
const ObjCObjectTypegetAsObjCInterfaceType () const
 
const ObjCObjectPointerTypegetAsObjCInterfacePointerType () const
 
const ObjCObjectPointerTypegetAsObjCQualifiedIdType () const
 
const ObjCObjectPointerTypegetAsObjCQualifiedClassType () const
 
const ObjCObjectTypegetAsObjCQualifiedInterfaceType () const
 
CXXRecordDeclgetAsCXXRecordDecl () const
 Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or because it is the injected-class-name type of a class template or class template partial specialization. More...
 
TagDeclgetAsTagDecl () const
 Retrieves the TagDecl that this type refers to, either because the type is a TagType or because it is the injected-class-name type of a class template or class template partial specialization. More...
 
const CXXRecordDeclgetPointeeCXXRecordDecl () const
 
AutoTypegetContainedAutoType () const
 Get the AutoType whose type will be deduced for a variable with an initializer of this type. This looks through declarators like pointer types, but not through decltype or typedefs. More...
 
template<typename T >
const T * getAs () const
 
const ArrayTypegetAsArrayTypeUnsafe () const
 
template<typename T >
const T * castAs () const
 
const ArrayTypecastAsArrayTypeUnsafe () const
 
const TypegetBaseElementTypeUnsafe () const
 
const TypegetArrayElementTypeNoTypeQual () const
 
QualType getPointeeType () const
 
const TypegetUnqualifiedDesugaredType () const
 
bool isPromotableIntegerType () const
 More type predicates useful for type checking/promotion. More...
 
bool isSignedIntegerType () const
 
bool isUnsignedIntegerType () const
 
bool isSignedIntegerOrEnumerationType () const
 
bool isUnsignedIntegerOrEnumerationType () const
 
bool isConstantSizeType () const
 
bool isSpecifierType () const
 
Linkage getLinkage () const
 Determine the linkage of this type. More...
 
Visibility getVisibility () const
 Determine the visibility of this type. More...
 
bool isVisibilityExplicit () const
 Return true if the visibility was explicitly set is the code. More...
 
LinkageInfo getLinkageAndVisibility () const
 Determine the linkage and visibility of this type. More...
 
bool isLinkageValid () const
 True if the computed linkage is valid. Used for consistency checking. Should always return true. More...
 
Optional< NullabilityKindgetNullability (const ASTContext &context) const
 
bool canHaveNullability () const
 
Optional< ArrayRef< QualType > > getObjCSubstitutions (const DeclContext *dc) const
 
bool acceptsObjCTypeParams () const
 
const char * getTypeClassName () const
 
QualType getCanonicalTypeInternal () const
 
CanQualType getCanonicalTypeUnqualified () const
 
void dump () const
 
template<>
const TypedefTypegetAs () const
 This will check for a TypedefType by removing any existing sugar until it reaches a TypedefType or a non-sugared type. More...
 
template<>
const TemplateSpecializationTypegetAs () const
 This will check for a TemplateSpecializationType by removing any existing sugar until it reaches a TemplateSpecializationType or a non-sugared type. More...
 
template<>
const AttributedTypegetAs () const
 This will check for an AttributedType by removing any existing sugar until it reaches an AttributedType or a non-sugared type. More...
 

Static Public Member Functions

static void Profile (llvm::FoldingSetNodeID &ID, QualType T)
 
static bool classof (const Type *T)
 

Friends

class ASTContext
 

Additional Inherited Members

- Protected Member Functions inherited from clang::Type
Typethis_ ()
 
 Type (TypeClass tc, QualType canon, bool Dependent, bool InstantiationDependent, bool VariablyModified, bool ContainsUnexpandedParameterPack)
 
void setDependent (bool D=true)
 
void setInstantiationDependent (bool D=true)
 
void setVariablyModified (bool VM=true)
 
void setContainsUnexpandedParameterPack (bool PP=true)
 
- Protected Attributes inherited from clang::Type
union {
   TypeBitfields   TypeBits
 
   ArrayTypeBitfields   ArrayTypeBits
 
   AttributedTypeBitfields   AttributedTypeBits
 
   AutoTypeBitfields   AutoTypeBits
 
   BuiltinTypeBitfields   BuiltinTypeBits
 
   FunctionTypeBitfields   FunctionTypeBits
 
   ObjCObjectTypeBitfields   ObjCObjectTypeBits
 
   ReferenceTypeBitfields   ReferenceTypeBits
 
   TypeWithKeywordBitfields   TypeWithKeywordBits
 
   VectorTypeBitfields   VectorTypeBits
 
}; 
 

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 4779 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 4900 of file Type.h.

Definition at line 4901 of file Type.h.

Member Function Documentation

static bool clang::ObjCObjectPointerType::classof ( const Type T)
inlinestatic

Definition at line 4946 of file Type.h.

References clang::Type::getTypeClass().

QualType clang::ObjCObjectPointerType::desugar ( ) const
inline

Definition at line 4925 of file Type.h.

References clang::ExtQualsTypeCommonBase::QualType.

ObjCInterfaceDecl* clang::ObjCObjectPointerType::getInterfaceDecl ( ) const
inline
const ObjCInterfaceType * ObjCObjectPointerType::getInterfaceType ( ) const

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 1423 of file Type.cpp.

References clang::Type::castAs(), and getObjectType().

Referenced by clang::ASTContext::canAssignObjCInterfacesInBlockPointer(), clang::Sema::DiagnoseAssignmentResult(), clang::Sema::HandleExprPropertyRefExpr(), and clang::Sema::isObjCPointerConversion().

unsigned clang::ObjCObjectPointerType::getNumProtocols ( ) const
inline

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

Definition at line 4914 of file Type.h.

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 4820 of file Type.h.

References clang::Type::castAs().

Referenced by clang::ASTContext::areCommonBaseCompatible(), clang::ASTContext::canAssignObjCInterfaces(), clang::Sema::CheckObjCForCollectionOperand(), clang::Sema::checkObjCKindOfType(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), getInterfaceType(), getIntersectionOfProtocols(), getSuperClassType(), isNSStringType(), clang::Type::isObjCIdOrObjectKindOfType(), LookupMemberExpr(), ShouldTryAgainWithRedefinitionType(), and stripObjCKindOfTypeAndQuals().

QualType clang::ObjCObjectPointerType::getPointeeType ( ) const
inline
ObjCProtocolDecl* clang::ObjCObjectPointerType::getProtocol ( unsigned  I) const
inline

Retrieve a qualifying protocol by index on the object type.

Definition at line 4920 of file Type.h.

QualType ObjCObjectPointerType::getSuperClassType ( ) const

Retrieve the type of the superclass of this object pointer type.

This operation substitutes any type arguments into the superclass of the current class type, potentially producing a pointer to a specialization of the superclass type. Produces a null type if there is no superclass.

Definition at line 1432 of file Type.cpp.

References clang::Decl::getASTContext(), getInterfaceDecl(), clang::ASTContext::getObjCObjectPointerType(), getObjectType(), clang::ObjCObjectType::getSuperClassType(), and clang::QualType::isNull().

ArrayRef<QualType> clang::ObjCObjectPointerType::getTypeArgs ( ) const
inline

Retrieve the type arguments for this type.

Definition at line 4888 of file Type.h.

ArrayRef<QualType> clang::ObjCObjectPointerType::getTypeArgsAsWritten ( ) const
inline

Retrieve the type arguments for this type.

Definition at line 4893 of file Type.h.

bool clang::ObjCObjectPointerType::isKindOfType ( ) 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.

Definition at line 4847 of file Type.h.

Referenced by CompareDerivedToBaseConversions(), clang::ento::cocoa::isCocoaObjectRef(), clang::Type::isObjCClassOrClassKindOfType(), clang::Type::isObjCIdOrObjectKindOfType(), and LookupMethodInReceiverType().

bool clang::ObjCObjectPointerType::isObjCIdOrClassType ( ) const
inline

isObjCIdOrClassType - True if this is equivalent to the 'id' or 'Class' type,

Definition at line 4853 of file Type.h.

bool clang::ObjCObjectPointerType::isObjCIdType ( ) const
inline
bool clang::ObjCObjectPointerType::isObjCQualifiedClassType ( ) const
inline

isObjCQualifiedClassType - True if this is equivalent to 'Class

' for some non-empty set of protocols.

Definition at line 4865 of file Type.h.

Referenced by clang::ento::cocoa::isCocoaObjectRef(), clang::Type::isObjCClassOrClassKindOfType(), and clang::Type::isObjCIdOrObjectKindOfType().

bool clang::ObjCObjectPointerType::isObjCQualifiedIdType ( ) const
inline

isObjCQualifiedIdType - True if this is equivalent to 'id

' for some non-empty set of protocols.

Definition at line 4859 of file Type.h.

Referenced by clang::ASTContext::canAssignObjCInterfacesInBlockPointer(), clang::Type::isBlockCompatibleObjCPointerType(), clang::ento::cocoa::isCocoaObjectRef(), and isObjCTypeSubstitutable().

bool clang::ObjCObjectPointerType::isSpecialized ( ) const
inline

Whether this type is specialized, meaning that it has type arguments.

Definition at line 4873 of file Type.h.

bool clang::ObjCObjectPointerType::isSpecializedAsWritten ( ) const
inline

Whether this type is specialized, meaning that it has type arguments.

Definition at line 4876 of file Type.h.

bool clang::ObjCObjectPointerType::isSugared ( ) const
inline

Definition at line 4924 of file Type.h.

bool clang::ObjCObjectPointerType::isUnspecialized ( ) const
inline

Whether this type is unspecialized, meaning that is has no type arguments.

Definition at line 4881 of file Type.h.

bool clang::ObjCObjectPointerType::isUnspecializedAsWritten ( ) const
inline

Determine whether this object type is "unspecialized" as written, meaning that it has no type arguments.

Definition at line 4885 of file Type.h.

void clang::ObjCObjectPointerType::Profile ( llvm::FoldingSetNodeID &  ID)
inline

Definition at line 4940 of file Type.h.

References clang::Type::getPointeeType().

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

static void clang::ObjCObjectPointerType::Profile ( llvm::FoldingSetNodeID &  ID,
QualType  T 
)
inlinestatic

Definition at line 4943 of file Type.h.

References clang::QualType::getAsOpaquePtr().

qual_iterator clang::ObjCObjectPointerType::qual_begin ( ) const
inline

Definition at line 4904 of file Type.h.

bool clang::ObjCObjectPointerType::qual_empty ( ) const
inline
qual_iterator clang::ObjCObjectPointerType::qual_end ( ) const
inline

Definition at line 4907 of file Type.h.

qual_range clang::ObjCObjectPointerType::quals ( ) const
inline
const ObjCObjectPointerType * ObjCObjectPointerType::stripObjCKindOfTypeAndQuals ( const ASTContext ctx) const

Friends And Related Function Documentation

friend class ASTContext
friend

Definition at line 4789 of file Type.h.


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