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
- public clang::TypeLoc IgnoreParens() const
- private static clang::TypeLoc IgnoreParensImpl(clang::TypeLoc TL)
- public TypeLoc(clang::QualType ty, void * opaqueData)
- public TypeLoc(const clang::Type * ty, void * opaqueData)
- public TypeLoc()
- public template <typename T>T castAs() const
- public void copy(clang::TypeLoc other)
- public clang::TypeLoc findExplicitQualifierLoc() const
- public clang::SourceLocation findNullabilityLoc() const
- public template <typename T>T getAs() const
- public template <typename T>T getAsAdjusted() const
- public clang::SourceLocation getBeginLoc() const
- public clang::AutoTypeLoc getContainedAutoTypeLoc() const
- public clang::SourceLocation getEndLoc() const
- public unsigned int getFullDataSize() const
- public static unsigned int getFullDataSizeForType(clang::QualType Ty)
- public static unsigned int getLocalAlignmentForType(clang::QualType Ty)
- public clang::SourceRange getLocalSourceRange() const
- private static clang::SourceRange getLocalSourceRangeImpl(clang::TypeLoc TL)
- public clang::TypeLoc getNextTypeLoc() const
- private static clang::TypeLoc getNextTypeLocImpl(clang::TypeLoc TL)
- public void * getOpaqueData() const
- public clang::SourceRange getSourceRange() const
- public clang::QualType getType() const
- public clang::TypeLoc::TypeLocClass getTypeLocClass() const
- public const clang::Type * getTypePtr() const
- public clang::UnqualTypeLoc getUnqualifiedLoc() const
- public void initialize(clang::ASTContext & Context, clang::SourceLocation Loc) const
- public void initializeFullCopy(clang::TypeLoc Other, unsigned int Size)
- public void initializeFullCopy(clang::TypeLoc Other)
- private static void initializeImpl(clang::ASTContext & Context, clang::TypeLoc TL, clang::SourceLocation Loc)
- private static bool isKind(const clang::TypeLoc &)
- public bool isNull() const
- public bool operator bool() const
Methods
¶clang::TypeLoc IgnoreParens() const
clang::TypeLoc IgnoreParens() const
Declared at: clang/include/clang/AST/TypeLoc.h:176
¶static clang::TypeLoc IgnoreParensImpl(
clang::TypeLoc TL)
static clang::TypeLoc IgnoreParensImpl(
clang::TypeLoc TL)
Declared at: clang/include/clang/AST/TypeLoc.h:239
Parameters
¶TypeLoc(clang::QualType ty, void* opaqueData)
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)
TypeLoc(const clang::Type* ty, void* opaqueData)
Declared at: clang/include/clang/AST/TypeLoc.h:69
Parameters
- const clang::Type* ty
- void* opaqueData
¶TypeLoc()
TypeLoc()
Declared at: clang/include/clang/AST/TypeLoc.h:66
¶template <typename T>
T castAs() const
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)
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
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
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
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
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
clang::SourceLocation getBeginLoc() const
Description
Get the begin source location.
Declared at: clang/include/clang/AST/TypeLoc.h:146
¶clang::AutoTypeLoc getContainedAutoTypeLoc() const
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
clang::SourceLocation getEndLoc() const
Description
Get the end source location.
Declared at: clang/include/clang/AST/TypeLoc.h:149
¶unsigned int getFullDataSize() const
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)
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
¶static unsigned int getLocalAlignmentForType(
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::SourceRange getLocalSourceRange() const
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)
static clang::SourceRange getLocalSourceRangeImpl(
clang::TypeLoc TL)
Declared at: clang/include/clang/AST/TypeLoc.h:240
Parameters
¶clang::TypeLoc getNextTypeLoc() const
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)
static clang::TypeLoc getNextTypeLocImpl(
clang::TypeLoc TL)
Declared at: clang/include/clang/AST/TypeLoc.h:238
Parameters
¶void* getOpaqueData() const
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
clang::SourceRange getSourceRange() const
Description
Get the full source range.
Declared at: clang/include/clang/AST/TypeLoc.h:152
¶clang::QualType getType() const
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
clang::TypeLoc::TypeLocClass getTypeLocClass()
const
Declared at: clang/include/clang/AST/TypeLoc.h:115
¶const clang::Type* getTypePtr() const
const clang::Type* getTypePtr() const
Declared at: clang/include/clang/AST/TypeLoc.h:136
¶clang::UnqualTypeLoc getUnqualifiedLoc() const
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
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)
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)
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)
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&)
static bool isKind(const clang::TypeLoc&)
Declared at: clang/include/clang/AST/TypeLoc.h:232
Parameters
- const clang::TypeLoc&
¶bool isNull() const
bool isNull() const
Declared at: clang/include/clang/AST/TypeLoc.h:120
¶bool operator bool() const
bool operator bool() const
Declared at: clang/include/clang/AST/TypeLoc.h:121