clang: clang::TypeSpecTypeLoc Class Reference (original) (raw)

A reasonable base class for TypeLocs that correspond to types that are written as a type-specifier. More...

#include "[clang/AST/TypeLoc.h](TypeLoc%5F8h%5Fsource.html)"

Public Types
enum { LocalDataSize = sizeof(TypeSpecLocInfo) , LocalDataAlignment = alignof(TypeSpecLocInfo) }
- Public Types inherited from clang::TypeLoc
enum TypeLocClass { Qualified }
The kinds of TypeLocs. More...
Public Member Functions
SourceLocation getNameLoc () const
void setNameLoc (SourceLocation Loc)
SourceRange getLocalSourceRange () const
void initializeLocal (ASTContext &Context, SourceLocation Loc)
- Public Member Functions inherited from clang::ConcreteTypeLoc< UnqualTypeLoc, TypeSpecTypeLoc, Type, TypeSpecLocInfo >
unsigned getLocalDataAlignment () const
unsigned getLocalDataSize () const
void copyLocal (TypeSpecTypeLoc other)
TypeLoc getNextTypeLoc () const
const Type * getTypePtr () const
- Public Member Functions inherited from clang::UnqualTypeLoc
UnqualTypeLoc ()=default
UnqualTypeLoc (const Type *Ty, void *Data)
const Type * getTypePtr () const
TypeLocClass getTypeLocClass () const
- Public Member Functions inherited from clang::TypeLoc
TypeLoc ()=default
TypeLoc (QualType ty, void *opaqueData)
TypeLoc (const Type *ty, void *opaqueData)
template<typename T >
T castAs () const
Convert to the specified [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") type, asserting that this [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") is of the desired type.
template<typename T >
T getAs () const
Convert to the specified [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") type, returning a null [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") if this [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") is not of the desired type.
template<typename T >
T getAsAdjusted () const
Convert to the specified [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") type, returning a null [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") if this [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") is not of the desired type.
TypeLocClass getTypeLocClass () const
bool isNull () const
operator bool () const
QualType getType () const
Get the type for which this source info wrapper provides information.
const Type * getTypePtr () const
void * getOpaqueData () const
Get the pointer where source information is stored.
SourceLocation getBeginLoc () const
Get the begin source location.
SourceLocation getEndLoc () const
Get the end source location.
SourceRange getSourceRange () const LLVM_READONLY
Get the full source range.
SourceRange getLocalSourceRange () const
Get the local source range.
unsigned getFullDataSize () const
Returns the size of the type source info data block.
TypeLoc getNextTypeLoc () const
Get the next [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") pointed by this [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info."), e.g for "int*" the [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") is a PointerLoc and next [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") is for "int".
UnqualTypeLoc getUnqualifiedLoc () const
Skips past any qualifiers, if this is qualified.
TypeLoc IgnoreParens () const
TypeLoc findExplicitQualifierLoc () const
Find a type with the location of an explicit type qualifier.
AutoTypeLoc getContainedAutoTypeLoc () const
Get the typeloc of an AutoType whose type will be deduced for a variable with an initializer of this type.
SourceLocation getTemplateKeywordLoc () const
Get the SourceLocation of the template keyword (if any).
void initialize (ASTContext &Context, SourceLocation Loc) const
Initializes this to state that every location in this type is the given location.
void initializeFullCopy (TypeLoc Other)
Initializes this by copying its information from another [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") of the same type.
void initializeFullCopy (TypeLoc Other, unsigned Size)
Initializes this by copying its information from another [TypeLoc](classclang%5F1%5F1TypeLoc.html "Base wrapper for a particular "section" of type source info.") of the same type.
void copy (TypeLoc other)
Copies the other type loc into this one.
SourceLocation findNullabilityLoc () const
Find the location of the nullability specifier (__nonnull, __nullable, or __null_unspecifier), if there is one.
void dump () const
void dump (llvm::raw_ostream &, const ASTContext &) const
Additional Inherited Members
- Static Public Member Functions inherited from clang::TypeLoc
static unsigned getFullDataSizeForType (QualType Ty)
Returns the size of type source info data block for the given type.
static unsigned getLocalAlignmentForType (QualType Ty)
Returns the alignment of type source info data block for the given type.
- Protected Member Functions inherited from clang::ConcreteTypeLoc< UnqualTypeLoc, TypeSpecTypeLoc, Type, TypeSpecLocInfo >
unsigned getExtraLocalDataSize () const
unsigned getExtraLocalDataAlignment () const
TypeSpecLocInfo * getLocalData () const
void * getExtraLocalData () const
Gets a pointer past the Info structure; useful for classes with local data that can't be captured in the Info (e.g.
void * getNonLocalData () const
HasNoInnerType getInnerType () const
TypeLoc getInnerTypeLoc () const
- Protected Attributes inherited from clang::TypeLoc
const void * Ty = nullptr
void * Data = nullptr

A reasonable base class for TypeLocs that correspond to types that are written as a type-specifier.

Definition at line 526 of file TypeLoc.h.

anonymous enum

Enumerator
LocalDataSize
LocalDataAlignment

Definition at line 531 of file TypeLoc.h.

getLocalSourceRange()

SourceRange clang::TypeSpecTypeLoc::getLocalSourceRange ( ) const inline

getNameLoc()

initializeLocal()

setNameLoc()

Definition at line 540 of file TypeLoc.h.

References clang::ConcreteTypeLoc< UnqualTypeLoc, TypeSpecTypeLoc, Type, TypeSpecLocInfo >::getLocalData(), Loc, and clang::TypeSpecLocInfo::NameLoc.

Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::BuildQualifiedDeclarationNameExpr(), initializeLocal(), clang::AutoTypeLoc::initializeLocal(), clang::Sema::InstantiateFunctionDefinition(), and clang::DeducedTemplateSpecializationTypeLoc::setTemplateNameLoc().

TypeLoc


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