class ObjCObjectType

Declaration

class ObjCObjectType : public Type, public ObjCProtocolQualifiers { /* full declaration omitted */ };

Description

Represents a class type in Objective C. Every Objective C type is a combination of a base type, a set of type arguments (optional, for parameterized classes) and a list of protocols. Given the following declarations: 'C' is an ObjCInterfaceType C. It is sugar for an ObjCObjectType with base C and no protocols. 'C <P >' is an unspecialized ObjCObjectType with base C and protocol list [P]. 'C <C *>' is a specialized ObjCObjectType with type arguments 'C*' and no protocol list. 'C <C *> <P >' is a specialized ObjCObjectType with base C, type arguments 'C*', and protocol list [P]. 'id' is a TypedefType which is sugar for an ObjCObjectPointerType whose pointee is an ObjCObjectType with base BuiltinType::ObjCIdType and no protocols. 'id <P >' is an ObjCObjectPointerType whose pointee is an ObjCObjectType with base BuiltinType::ObjCIdType and protocol list [P]. Eventually this should get its own sugar class to better represent the source.

Declared at: clang/include/clang/AST/Type.h:5951

Inherits from: Type, ObjCProtocolQualifiers

Member Variables

private clang::QualType BaseType
Either a BuiltinType or an InterfaceType or sugar for either.
private llvm:: PointerIntPair<const ObjCObjectType*, 1, bool> CachedSuperClassType
Cached superclass type.

Inherited from Type:

protected

Method Overview

Inherited from Type:

Inherited from ExtQualsTypeCommonBase:

    Methods

    ObjCObjectType(
        clang::QualType Canonical,
        clang::QualType Base,
        ArrayRef<clang::QualType> typeArgs,
        ArrayRef<clang::ObjCProtocolDecl*> protocols,
        bool isKindOf)

    Declared at: clang/include/clang/AST/Type.h:5992

    Parameters

    clang::QualType Canonical
    clang::QualType Base
    ArrayRef<clang::QualType> typeArgs
    ArrayRef<clang::ObjCProtocolDecl*> protocols
    bool isKindOf

    ObjCObjectType(enum Nonce_ObjCInterface)

    Declared at: clang/include/clang/AST/Type.h:5997

    Parameters

    enum Nonce_ObjCInterface

    static bool classof(const clang::Type* T)

    Declared at: clang/include/clang/AST/Type.h:6094

    Parameters

    const clang::Type* T

    void computeSuperClassTypeSlow() const

    Declared at: clang/include/clang/AST/Type.h:6005

    clang::QualType desugar() const

    Declared at: clang/include/clang/AST/Type.h:6092

    clang::QualType getBaseType() const

    Description

    Gets the base type of this object type. This is always (possibly sugar for) one of: - the 'id' builtin type (as opposed to the 'id' type visible to the user, which is a typedef for an ObjCObjectPointerType) - the 'Class' builtin type (same caveat) - an ObjCObjectType (currently always an ObjCInterfaceType)

    Declared at: clang/include/clang/AST/Type.h:6014

    clang::ObjCInterfaceDecl* getInterface() const

    Description

    Gets the interface declaration for this object type, if the base type really is an interface.

    Declared at: clang/include/clang/AST/Type.h:6038

    unsigned int getNumProtocolsImpl() const

    Description

    Return the number of qualifying protocols in this interface type, or 0 if there are none.

    Declared at: clang/include/clang/AST/Type.h:5982

    clang::ObjCProtocolDecl** getProtocolStorageImpl()

    Declared at: clang/include/clang/AST/Type.h:5979

    clang::QualType getSuperClassType() const

    Description

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

    Declared at: clang/include/clang/AST/Type.h:6079

    const clang::QualType* getTypeArgStorage() const

    Declared at: clang/include/clang/AST/Type.h:5975

    clang::QualType* getTypeArgStorage()

    Declared at: clang/include/clang/AST/Type.h:5974

    ArrayRef<clang::QualType> getTypeArgs() const

    Description

    Retrieve the type arguments of this object type (semantically).

    Declared at: clang/include/clang/AST/Type.h:6058

    ArrayRef<clang::QualType> getTypeArgsAsWritten()
        const

    Description

    Retrieve the type arguments of this object type as they were written.

    Declared at: clang/include/clang/AST/Type.h:6062

    bool isKindOfType() const

    Description

    Whether this ia a "__kindof" type (semantically).

    Declared at: clang/include/clang/AST/Type.h:6071

    bool isKindOfTypeAsWritten() const

    Description

    Whether this is a "__kindof" type as written.

    Declared at: clang/include/clang/AST/Type.h:6068

    bool isObjCClass() const

    Declared at: clang/include/clang/AST/Type.h:6020

    bool isObjCId() const

    Declared at: clang/include/clang/AST/Type.h:6016

    bool isObjCQualifiedClass() const

    Declared at: clang/include/clang/AST/Type.h:6034

    bool isObjCQualifiedId() const

    Declared at: clang/include/clang/AST/Type.h:6033

    bool isObjCUnqualifiedClass() const

    Declared at: clang/include/clang/AST/Type.h:6025

    bool isObjCUnqualifiedId() const

    Declared at: clang/include/clang/AST/Type.h:6024

    bool isObjCUnqualifiedIdOrClass() const

    Declared at: clang/include/clang/AST/Type.h:6026

    bool isSpecialized() const

    Description

    Determine whether this object type is "specialized", meaning that it has type arguments.

    Declared at: clang/include/clang/AST/Type.h:6042

    bool isSpecializedAsWritten() const

    Description

    Determine whether this object type was written with type arguments.

    Declared at: clang/include/clang/AST/Type.h:6045

    bool isSugared() const

    Declared at: clang/include/clang/AST/Type.h:6091

    bool isUnspecialized() const

    Description

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

    Declared at: clang/include/clang/AST/Type.h:6051

    bool isUnspecializedAsWritten() const

    Description

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

    Declared at: clang/include/clang/AST/Type.h:6055

    void setNumProtocolsImpl(unsigned int N)

    Declared at: clang/include/clang/AST/Type.h:5985

    Parameters

    unsigned int N

    clang::QualType stripObjCKindOfTypeAndQuals(
        const clang::ASTContext& ctx) const

    Description

    Strip off the Objective-C "kindof" type and (with it) any protocol qualifiers.

    Declared at: clang/include/clang/AST/Type.h:6089

    Parameters

    const clang::ASTContext& ctx