class TypeLoc

Declaration

class TypeLoc { /* full declaration omitted */ };

Description

Base wrapper for a particular "section" of type source info. A client should use the TypeLoc subclasses through castAs()/getAs() in order to get at the actual information.

Declared at: clang/include/clang/AST/TypeLoc.h:58

Member Variables

protected const void* Ty = nullptr
protected void* Data = nullptr

Method Overview

Methods

clang::TypeLoc IgnoreParens() const

Declared at: clang/include/clang/AST/TypeLoc.h:176

static clang::TypeLoc IgnoreParensImpl(
    clang::TypeLoc TL)

Declared at: clang/include/clang/AST/TypeLoc.h:239

Parameters

clang::TypeLoc TL

TypeLoc(clang::QualType ty, void* opaqueData)

Declared at: clang/include/clang/AST/TypeLoc.h:67

Parameters

clang::QualType ty
void* opaqueData

TypeLoc(const clang::Type* ty, void* opaqueData)

Declared at: clang/include/clang/AST/TypeLoc.h:69

Parameters

const clang::Type* ty
void* opaqueData

TypeLoc()

Declared at: clang/include/clang/AST/TypeLoc.h:66

template <typename T>
T castAs() const

Description

Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type.

Declared at: clang/include/clang/AST/TypeLoc.h:77

Templates

T

void copy(clang::TypeLoc other)

Description

Copies the other type loc into this one.

Declared at: clang/include/clang/AST/TypeLoc.h:217

Parameters

clang::TypeLoc other

clang::TypeLoc findExplicitQualifierLoc() const

Description

Find a type with the location of an explicit type qualifier. The result, if non-null, will be one of: QualifiedTypeLoc AtomicTypeLoc AttributedTypeLoc, for those type attributes that behave as qualifiers

Declared at: clang/include/clang/AST/TypeLoc.h:184

clang::SourceLocation findNullabilityLoc() const

Description

Find the location of the nullability specifier (__nonnull, __nullable, or __null_unspecifier), if there is one.

Declared at: clang/include/clang/AST/TypeLoc.h:229

template <typename T>
T getAs() const

Description

Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired type.

Declared at: clang/include/clang/AST/TypeLoc.h:88

Templates

T

template <typename T>
T getAsAdjusted() const

Description

Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired type. It will consider type adjustments from a type that was written as a T to another type that is still canonically a T (ignores parens, attributes, elaborated types, etc).

Declared at: clang/include/clang/AST/TypeLoc.h:102

Templates

T

clang::SourceLocation getBeginLoc() const

Description

Get the begin source location.

Declared at: clang/include/clang/AST/TypeLoc.h:146

clang::AutoTypeLoc getContainedAutoTypeLoc() const

Description

Get the typeloc of an 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.

Declared at: clang/include/clang/AST/TypeLoc.h:189

clang::SourceLocation getEndLoc() const

Description

Get the end source location.

Declared at: clang/include/clang/AST/TypeLoc.h:149

unsigned int getFullDataSize() const

Description

Returns the size of the type source info data block.

Declared at: clang/include/clang/AST/TypeLoc.h:163

static unsigned int getFullDataSizeForType(
    clang::QualType Ty)

Description

Returns the size of type source info data block for the given type.

Declared at: clang/include/clang/AST/TypeLoc.h:124

Parameters

clang::QualType Ty

static unsigned int getLocalAlignmentForType(
    clang::QualType Ty)

Description

Returns the alignment of type source info data block for the given type.

Declared at: clang/include/clang/AST/TypeLoc.h:128

Parameters

clang::QualType Ty

clang::SourceRange getLocalSourceRange() const

Description

Get the local source range.

Declared at: clang/include/clang/AST/TypeLoc.h:158

static clang::SourceRange getLocalSourceRangeImpl(
    clang::TypeLoc TL)

Declared at: clang/include/clang/AST/TypeLoc.h:240

Parameters

clang::TypeLoc TL

clang::TypeLoc getNextTypeLoc() const

Description

Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the TypeLoc is a PointerLoc and next TypeLoc is for "int".

Declared at: clang/include/clang/AST/TypeLoc.h:169

static clang::TypeLoc getNextTypeLocImpl(
    clang::TypeLoc TL)

Declared at: clang/include/clang/AST/TypeLoc.h:238

Parameters

clang::TypeLoc TL

void* getOpaqueData() const

Description

Get the pointer where source information is stored.

Declared at: clang/include/clang/AST/TypeLoc.h:141

clang::SourceRange getSourceRange() const

Description

Get the full source range.

Declared at: clang/include/clang/AST/TypeLoc.h:152

clang::QualType getType() const

Description

Get the type for which this source info wrapper provides information.

Declared at: clang/include/clang/AST/TypeLoc.h:132

clang::TypeLoc::TypeLocClass getTypeLocClass()
    const

Declared at: clang/include/clang/AST/TypeLoc.h:115

const clang::Type* getTypePtr() const

Declared at: clang/include/clang/AST/TypeLoc.h:136

clang::UnqualTypeLoc getUnqualifiedLoc() const

Description

Skips past any qualifiers, if this is qualified.

Declared at: clang/include/clang/AST/TypeLoc.h:174

void initialize(clang::ASTContext& Context,
                clang::SourceLocation Loc) const

Description

Initializes this to state that every location in this type is the given location. This method exists to provide a simple transition for code that relies on location-less types.

Declared at: clang/include/clang/AST/TypeLoc.h:196

Parameters

clang::ASTContext& Context
clang::SourceLocation Loc

void initializeFullCopy(clang::TypeLoc Other,
                        unsigned int Size)

Description

Initializes this by copying its information from another TypeLoc of the same type. The given size must be the full data size.

Declared at: clang/include/clang/AST/TypeLoc.h:210

Parameters

clang::TypeLoc Other
unsigned int Size

void initializeFullCopy(clang::TypeLoc Other)

Description

Initializes this by copying its information from another TypeLoc of the same type.

Declared at: clang/include/clang/AST/TypeLoc.h:202

Parameters

clang::TypeLoc Other

static void initializeImpl(
    clang::ASTContext& Context,
    clang::TypeLoc TL,
    clang::SourceLocation Loc)

Declared at: clang/include/clang/AST/TypeLoc.h:236

Parameters

clang::ASTContext& Context
clang::TypeLoc TL
clang::SourceLocation Loc

static bool isKind(const clang::TypeLoc&)

Declared at: clang/include/clang/AST/TypeLoc.h:232

Parameters

const clang::TypeLoc&

bool isNull() const

Declared at: clang/include/clang/AST/TypeLoc.h:120

bool operator bool() const

Declared at: clang/include/clang/AST/TypeLoc.h:121