Go to the documentation of this file.
14 #ifndef LLVM_CLANG_AST_TYPELOC_H
15 #define LLVM_CLANG_AST_TYPELOC_H
24 #include "llvm/ADT/ArrayRef.h"
25 #include "llvm/Support/Casting.h"
26 #include "llvm/Support/Compiler.h"
27 #include "llvm/Support/MathExtras.h"
40 class ObjCInterfaceDecl;
41 class ObjCProtocolDecl;
42 class ObjCTypeParamDecl;
44 class TemplateTypeParmDecl;
46 class UnresolvedUsingTypenameDecl;
49 #define ABSTRACT_TYPELOC(Class, Base)
50 #define TYPELOC(Class, Base) \
52 #include "clang/AST/TypeLocNodes.def"
62 const void *
Ty =
nullptr;
68 :
Ty(ty.getAsOpaquePtr()),
Data(opaqueData) {}
70 :
Ty(ty),
Data(opaqueData) {}
78 assert(T::isKind(*
this));
89 if (!T::isKind(*
this))
101 template <
typename T>
108 #define ABSTRACT_TYPE(Class, Base)
109 #define TYPE(Class, Base) \
111 #include "clang/AST/TypeNodes.inc"
121 explicit operator bool()
const {
return Ty; }
159 return getLocalSourceRangeImpl(*
this);
170 return getNextTypeLocImpl(*
this);
197 initializeImpl(Context, *
this, Loc);
203 assert(
getType() == Other.getType());
211 assert(
getType() == Other.getType());
224 return !(LHS == RHS);
232 static bool isKind(
const TypeLoc&) {
236 static void initializeImpl(ASTContext &Context,
TypeLoc TL,
240 static SourceRange getLocalSourceRangeImpl(
TypeLoc TL);
246 return TypeLoc(Ty,
const_cast<void*
>(
static_cast<const void*
>(
this + 1)));
257 return reinterpret_cast<const Type*
>(
Ty);
267 static bool isKind(
const TypeLoc &TL) {
285 dataInt = llvm::alignTo(dataInt,
align);
321 static bool isKind(
const TypeLoc &TL) {
329 return castAs<UnqualTypeLoc>();
360 template <
class Base,
class Derived,
class TypeClass,
class LocalData>
364 const Derived *asDerived()
const {
365 return static_cast<const Derived*
>(
this);
368 static bool isKind(
const TypeLoc &TL) {
373 static bool classofType(
const Type *Ty) {
374 return TypeClass::classof(Ty);
379 return std::max(
unsigned(
alignof(LocalData)),
384 unsigned size =
sizeof(LocalData);
385 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
386 size = llvm::alignTo(size, extraAlign);
387 size += asDerived()->getExtraLocalDataSize();
410 return cast<TypeClass>(Base::getTypePtr());
423 return static_cast<LocalData*
>(Base::Data);
430 unsigned size =
sizeof(LocalData);
431 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
432 size = llvm::alignTo(size, extraAlign);
433 return reinterpret_cast<char *
>(Base::Data) + size;
437 auto data =
reinterpret_cast<uintptr_t>(Base::Data);
438 data += asDerived()->getLocalDataSize();
439 data = llvm::alignTo(data, getNextTypeAlign());
440 return reinterpret_cast<void*
>(data);
451 unsigned getInnerTypeSize()
const {
455 unsigned getInnerTypeSize(HasNoInnerType _)
const {
459 unsigned getInnerTypeSize(QualType _)
const {
463 unsigned getNextTypeAlign()
const {
467 unsigned getNextTypeAlign(HasNoInnerType _)
const {
471 unsigned getNextTypeAlign(QualType T)
const {
485 template <
class Base,
class Derived,
class TypeClass>
489 static bool classofType(
const Type *Ty) {
490 return TypeClass::classof(Ty);
493 static bool isKind(
const TypeLoc &TL) {
497 static bool isKind(
const UnqualTypeLoc &TL) {
498 return Derived::classofType(TL.getTypePtr());
503 return cast<TypeClass>(Base::getTypePtr());
542 static bool isKind(
const TypeLoc &TL);
566 BuiltinRange = Range;
584 return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128) ||
585 (bk >= BuiltinType::Short && bk <= BuiltinType::Ibm128) ||
586 bk == BuiltinType::UChar || bk == BuiltinType::SChar;
670 UsingTypeLoc, UsingType> {
692 InjectedClassNameTypeLoc,
693 InjectedClassNameType> {
703 UnresolvedUsingTypeLoc,
704 UnresolvedUsingType> {
745 TemplateTypeParmTypeLoc,
746 TemplateTypeParmType> {
758 ObjCTypeParamTypeLoc,
760 ObjCTypeParamTypeLocInfo> {
803 return getProtocolLocArray()[i];
808 getProtocolLocArray()[i] = Loc;
844 SubstTemplateTypeParmTypeLoc,
845 SubstTemplateTypeParmType> {
851 SubstTemplateTypeParmPackTypeLoc,
852 SubstTemplateTypeParmPackType> {
890 return dyn_cast_or_null<T>(
getAttr());
909 BTFTagAttributedType, BTFTagAttributedLocInfo> {
917 return dyn_cast_or_null<T>(
getAttr());
943 ObjCObjectTypeLocInfo> {
978 return getTypeArgLocArray()[i];
983 getTypeArgLocArray()[i] = TInfo;
1008 return getProtocolLocArray()[i];
1013 getProtocolLocArray()[i] = Loc;
1057 "not enough alignment for tail-allocated data");
1073 ObjCInterfaceTypeLoc,
1075 ObjCInterfaceLocInfo> {
1113 MacroQualifiedType, MacroQualifiedLocInfo> {
1184 if (ParenTypeLoc::isKind(*
this))
1185 return IgnoreParensImpl(*
this);
1192 AdjustedType, AdjustedLocInfo> {
1220 AdjustedTypeLoc, DecayedTypeLoc, DecayedType> {
1228 template <
class Derived,
class TypeClass,
class LocalData = Po
interLikeLocInfo>
1230 TypeClass, LocalData> {
1290 MemberPointerLocInfo> {
1328 ObjCObjectPointerType> {
1349 LValueReferenceTypeLoc,
1350 LValueReferenceType> {
1363 RValueReferenceTypeLoc,
1364 RValueReferenceType> {
1387 bool hasExceptionSpec()
const {
1388 if (
auto *FPT = dyn_cast<FunctionProtoType>(
getTypePtr())) {
1389 return FPT->hasExceptionSpec();
1395 assert(hasExceptionSpec() &&
"No exception spec range");
1439 if (hasExceptionSpec())
1440 return *getExceptionSpecRangePtr();
1445 if (hasExceptionSpec())
1446 *getExceptionSpecRangePtr() = R;
1461 return cast<FunctionProtoType>(
getTypePtr())->getNumParams();
1482 if (hasExceptionSpec())
1489 unsigned ExceptSpecSize = hasExceptionSpec() ?
sizeof(
SourceRange) : 0;
1500 FunctionProtoTypeLoc,
1501 FunctionProtoType> {
1506 FunctionNoProtoTypeLoc,
1507 FunctionNoProtoType> {
1568 ConstantArrayTypeLoc,
1569 ConstantArrayType> {
1574 IncompleteArrayTypeLoc,
1575 IncompleteArrayType> {
1580 DependentSizedArrayTypeLoc,
1581 DependentSizedArrayType> {
1591 VariableArrayTypeLoc,
1592 VariableArrayType> {
1608 TemplateSpecializationTypeLoc,
1609 TemplateSpecializationType,
1610 TemplateSpecializationLocInfo> {
1641 getArgInfos()[i] = AI;
1645 return getArgInfos()[i];
1686 getArgInfos(), Loc);
1716 DependentAddressSpaceTypeLoc,
1717 DependentAddressSpaceType,
1718 DependentAddressSpaceLocInfo> {
1790 VectorType, VectorTypeLocInfo> {
1813 DependentVectorType, VectorTypeLocInfo> {
1840 :
public ConcreteTypeLoc<UnqualTypeLoc, DependentSizedExtVectorTypeLoc,
1841 DependentSizedExtVectorType, VectorTypeLocInfo> {
1868 MatrixType, MatrixTypeLocInfo> {
1915 ConstantMatrixType> {};
1919 DependentSizedMatrixTypeLoc,
1920 DependentSizedMatrixType> {};
1941 template <
class Derived,
class TypeClass,
class LocalData = TypeofLocInfo>
1943 :
public ConcreteTypeLoc<UnqualTypeLoc, Derived, TypeClass, LocalData> {
1991 TypeOfExprTypeLocInfo> {
2031 :
public ConcreteTypeLoc<UnqualTypeLoc, DecltypeTypeLoc, DecltypeType,
2032 DecltypeTypeLocInfo> {
2060 UnaryTransformTypeLoc,
2062 UnaryTransformTypeLocInfo> {
2196 getArgInfos()[i] = AI;
2200 return getArgInfos()[i];
2242 DeducedTemplateSpecializationTypeLoc,
2243 DeducedTemplateSpecializationType> {
2264 ElaboratedLocInfo> {
2287 "Inconsistent nested-name-specifier pointer");
2342 DependentNameTypeLoc,
2344 DependentNameLocInfo> {
2362 "Inconsistent nested-name-specifier pointer");
2399 DependentTemplateSpecializationTypeLoc,
2400 DependentTemplateSpecializationType,
2401 DependentTemplateSpecializationLocInfo> {
2420 if (!QualifierLoc) {
2431 "Inconsistent nested-name-specifier pointer");
2472 getArgInfos()[i] = AI;
2476 return getArgInfos()[i];
2523 PackExpansionType, PackExpansionTypeLocInfo> {
2555 AtomicType, AtomicTypeLocInfo> {
2630 template <
typename T>
2633 while (!T::isKind(Cur)) {
2635 Cur = PTL.getInnerLoc();
2637 Cur = ATL.getModifiedLoc();
2639 Cur = ATL.getWrappedLoc();
2641 Cur = ETL.getNamedTypeLoc();
2643 Cur = ATL.getOriginalLoc();
2645 Cur = MQL.getInnerLoc();
2649 return Cur.
getAs<T>();
2656 DependentBitIntType> {};
2664 : Protocol(protocol), Loc(loc) {}
2676 #endif // LLVM_CLANG_AST_TYPELOC_H
SourceRange getLocalSourceRange() const
void setBegin(SourceLocation b)
void setTemplateKeywordLoc(SourceLocation Loc)
void setRParenLoc(SourceLocation Loc)
Represents an ObjC class declaration.
SourceRange getLocalSourceRange() const
SourceLocation getProtocolLAngleLoc() const
Wraps an ObjCPointerType with source location information.
TypeLoc getInnerLoc() const
SourceRange getLocalSourceRange() const
void setBuiltinLoc(SourceLocation Loc)
SourceLocation getStarLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
unsigned getNumParams() const
Expr * getUnderlyingExpr() const
__DEVICE__ int max(int __a, int __b)
void setKWLoc(SourceLocation Loc)
SourceRange getParensRange() const
void setLBracketLoc(SourceLocation Loc)
SourceLocation LBracketLoc
QualType getInnerType() const
TypeLocClass getTypeLocClass() const
SourceLocation getNameLoc() const
void setSigilLoc(SourceLocation Loc)
SourceRange OperandParens
SourceLocation getRParenLoc() const
SourceRange getLocalSourceRange() const
SourceRange getLocalSourceRange() const
SourceRange getLocalSourceRange() const
SourceLocation ProtocolRAngleLoc
QualType getInnerType() const
UsingShadowDecl * getFoundDecl() const
SourceRange getParensRange() const
Expr * getAttrColumnOperand() const
The attribute's column operand, if it has one.
ArrayRef< ParmVarDecl * > getParams() const
QualType getInnerType() const
SourceLocation ElaboratedKWLoc
void setAttr(const Attr *A)
TemplateTypeParmDecl * getDecl() const
constexpr size_t align(size_t Size)
Aligns a size to the pointer alignment.
NestedNameSpecifierLoc getQualifierLoc() const
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
SourceLocation ProtocolLAngleLoc
QualType getUnmodifiedType() const
Wrapper for source info for block pointers.
TypeLoc getNextTypeLoc() const
bool isConstrained() const
A trivial tuple used to represent a source range.
void setTemplateKeywordLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Wrapper for source info for pointers.
ConceptDecl * getTypeConstraintConcept() const
void copy(TypeLoc other)
Copies the other type loc into this one.
bool hasBaseTypeAsWritten() const
QualType getElementType() const
void setLParenLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
TypeSpecifierSign
Specifies the signedness of a type, e.g., signed or unsigned.
LocalData * getLocalData() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getInnerType() const
TypeLoc getElementLoc() const
void setFoundDecl(NamedDecl *D)
void setNameLoc(SourceLocation Loc)
TypeSpecifierType getWrittenTypeSpec() const
SourceLocation TemplateKWLoc
Encodes a location in the source.
ArrayRef< SourceLocation > getProtocolLocs() const
unsigned getExtraLocalDataSize() const
This represents a decl that may have a name.
SourceRange getLocalSourceRange() const
SourceLocation getBegin() const
void initializeLocal(ASTContext &Context, SourceLocation loc)
void expandBuiltinRange(SourceRange Range)
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
A (possibly-)qualified type.
void setTypeArgTInfo(unsigned i, TypeSourceInfo *TInfo)
Expr * getUnderlyingExpr() const
SourceRange getLocalSourceRange() const
void setLocalRangeEnd(SourceLocation L)
unsigned getLocalDataAlignment() const
SourceRange getBracketsRange() const
ObjCProtocolLoc(ObjCProtocolDecl *protocol, SourceLocation loc)
void setNameEndLoc(SourceLocation Loc)
void setAttrColumnOperand(Expr *e)
SourceRange getLocalSourceRange() const
Represents a parameter to a function.
void copyLocal(TypeLoc other)
void setRAngleLoc(SourceLocation Loc)
unsigned getLocalDataSize() const
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
static void initializeArgLocs(ASTContext &Context, ArrayRef< TemplateArgument > Args, TemplateArgumentLocInfo *ArgInfos, SourceLocation Loc)
QualType getElementType() const
bool hasWrittenTypeSpec() const
TypeLoc(const Type *ty, void *opaqueData)
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
bool isDefinition() const
True if the tag was defined in this type specifier.
bool hasWrittenSignSpec() const
static unsigned getFullDataSizeForType(QualType Ty)
Returns the size of type source info data block for the given type.
unsigned getExtraLocalDataAlignment() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceRange getExceptionSpecRange() const
void setAttrOperandParensRange(SourceRange range)
ObjCTypeParamDecl * getDecl() const
SourceLocation getLParenLoc() const
const Attr * getAttr() const
The type attribute.
HasNoInnerType getInnerType() const
SourceLocation getEndLoc() const
Get the end source location.
SourceRange getLocalSourceRange() const
TypeLoc getNextTypeLoc() const
SourceLocation getNameLoc() const
bool isConstrained() const
TypeSourceInfo * getTypeArgTInfo(unsigned i) const
TypeLoc getElementLoc() const
void setNameLoc(SourceLocation Loc)
QualType getPointeeTypeAsWritten() const
void initialize(ASTContext &Context, SourceLocation Loc) const
Initializes this to state that every location in this type is the given location.
Wrapper for source info for ObjC interfaces.
TypeLoc getBaseLoc() const
SourceLocation getTemplateKeywordLoc() const
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
TemplateArgumentLoc getArgLoc(unsigned i) const
const TypeClass * getTypePtr() const
SourceRange getLocalSourceRange() const
UnresolvedUsingTypenameDecl * getDecl() const
void setProtocolLoc(unsigned i, SourceLocation Loc)
void * getOpaqueData() const
Get the pointer where source information is stored.
void setProtocolLoc(unsigned i, SourceLocation Loc)
void setTemplateNameLoc(SourceLocation Loc)
void setAmpLoc(SourceLocation Loc)
QualType getInnerType() const
bool hasExplicitTemplateArgs() const
NamedDecl * getFoundDecl() const
Wrapper for source info for types used via transparent aliases.
SourceLocation getStarLoc() const
const Type * getTypePtr() const
SourceLocation getNameEndLoc() const
SourceLocation getLocation() const
SourceLocation TemplateKWLoc
void setParensRange(SourceRange Range)
void setElaboratedKeywordLoc(SourceLocation Loc)
unsigned getExtraLocalDataSize() const
Wrapper of type source information for a type with no direct qualifiers.
SourceRange getLocalSourceRange() const
SourceLocation getExpansionLoc() const
The base class of the type hierarchy.
void setProtocolRAngleLoc(SourceLocation Loc)
unsigned getExtraLocalDataSize() const
SourceRange getLocalSourceRange() const
ProtocolLAngleLoc, ProtocolRAngleLoc, and the source locations for protocol qualifiers are stored aft...
SourceLocation getProtocolRAngleLoc() const
void setProtocolLAngleLoc(SourceLocation Loc)
unsigned getExtraLocalDataAlignment() const
Type source information for an btf_tag attributed type.
SourceLocation getBeginLoc() const
Get the begin source location.
QualType getInnerType() const
SourceLocation getLAngleLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
SourceLocation getProtocolRAngleLoc() const
Wrapper for source info for functions.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Represents a dependent using declaration which was marked with typename.
void setLAngleLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
bool isDecltypeAuto() const
SourceLocation EllipsisLoc
void setHasBaseTypeAsWritten(bool HasBaseType)
NestedNameSpecifierLoc getQualifierLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getPattern() const
Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated w...
SourceRange getLocalSourceRange() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getInnerType() const
Returns the type before the address space attribute application area.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
__DEVICE__ int min(int __a, int __b)
void setStarLoc(SourceLocation Loc)
Wrapper for substituted template type parameters.
unsigned getExtraLocalDataAlignment() const
SourceLocation getRParenLoc() const
SourceLocation LocalRangeBegin
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
SourceLocation getTypeArgsRAngleLoc() const
void setModeAttr(bool written)
Expr * getAttrRowOperand() const
The attribute's row operand, if it has one.
SourceLocation getTemplateNameLoc() const
Wrapper of type source information for a type with non-trivial direct qualifiers.
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
void setParensRange(SourceRange range)
SourceLocation TemplateKWLoc
void setAttrNameLoc(SourceLocation loc)
attr::Kind getAttrKind() const
SourceLocation getElaboratedKeywordLoc() const
SourceRange getLocalSourceRange() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
TypeSpecifierSign getWrittenSignSpec() const
QualType getInnerType() const
unsigned getExtraLocalDataSize() const
Returns the size of the type source info data block that is specific to this type.
void setTemplateKWLoc(SourceLocation Loc)
SourceLocation getEllipsisLoc() const
void setCaretLoc(SourceLocation Loc)
Declaration of a C++20 concept.
const IdentifierInfo * getMacroIdentifier() const
unsigned getExtraLocalDataAlignment() const
SourceLocation getProtocolLAngleLoc() const
SourceLocation getProtocolLoc(unsigned i) const
SourceLocation getEnd() const
void setLParenLoc(SourceLocation Loc)
void setNameLoc(SourceLocation Loc)
void setLocalRangeBegin(SourceLocation L)
unsigned getNumProtocols() const
SourceRange getLocalSourceRange() const
qual_iterator qual_begin() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
TagDecl * getDecl() const
ArrayRef< SourceLocation > getProtocolLocs() const
SourceRange getLocalSourceRange() const
void copy(DependentTemplateSpecializationTypeLoc Loc)
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
void initializeLocal(ASTContext &Context, SourceLocation loc)
SourceLocation RBracketLoc
AutoTypeKeyword getKeyword() const
void setRParenLoc(SourceLocation Loc)
const Type * getClass() const
QualType getInnerType() const
void setRAngleLoc(SourceLocation Loc)
SourceLocation getAmpLoc() const
SourceLocation getNameLoc() const
TypeLoc getInnerLoc() const
SourceLocation getTypeArgsLAngleLoc() const
AutoTypeLoc getContainedAutoTypeLoc() const
Get the typeloc of an AutoType whose type will be deduced for a variable with an initializer of this ...
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
TemplateArgumentLoc getArgLoc(unsigned i) const
void setExceptionSpecRange(SourceRange R)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setRParenLoc(SourceLocation Loc)
Location wrapper for a TemplateArgument.
SourceLocation getNameLoc() const
QualType getInnerType() const
Wrapper for source info for injected class names of class templates.
unsigned getNumProtocols() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void copy(TemplateSpecializationTypeLoc Loc)
void * getNonLocalData() const
EnumDecl * getDecl() const
SourceLocation getLocalRangeBegin() const
SourceRange getLocalSourceRange() const
SourceLocation getLParenLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getInnerType() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setLParenLoc(SourceLocation Loc)
Wrapper for source info for record types.
Represents the declaration of a struct/union/class/enum.
QualType getInnerType() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setEnd(SourceLocation e)
QualType getUnderlyingType() const
QualType getBaseType() const
Gets the base type of this object type.
friend bool operator==(const TypeLoc &LHS, const TypeLoc &RHS)
SourceLocation LocalRangeEnd
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getElaboratedKeywordLoc() const
QualType getPointeeType() const
TypeLoc getElementLoc() const
TypeSpecifierWidth getWrittenWidthSpec() const
TypeLocClass
The kinds of TypeLocs.
SourceRange getLocalSourceRange() const
SourceLocation getLocalRangeEnd() const
const Type * getClass() const
Type source information for an attributed type.
A C++ nested-name-specifier augmented with source location information.
SourceRange getSourceRange() const LLVM_READONLY
The source range is just the protocol name.
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
unsigned getExtraLocalDataSize() const
unsigned getLocalDataAlignment() const
bool needsExtraLocalData() const
SourceLocation getSigilLoc() const
UnqualTypeLoc(const Type *Ty, void *Data)
QualType getInnerType() const
QualType getInnerType() const
Wrapper for source info for member pointers.
SourceLocation getNameLoc() const
void setTemplateNameLoc(SourceLocation Loc)
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
SourceRange getLocalSourceRange() const
SourceLocation getLParenLoc() const
TypeSourceInfo * ClassTInfo
QualType getUnderlyingType() const
void setRParenLoc(SourceLocation Loc)
QualType getValueType() const
Gets the type contained by this atomic type, i.e.
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
SourceLocation getCaretLoc() const
SourceLocation getTemplateNameLoc() const
SourceLocation getAmpAmpLoc() const
ArrayRef< TemplateArgument > template_arguments() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setAmpAmpLoc(SourceLocation Loc)
Declaration of a template type parameter.
void setLAngleLoc(SourceLocation Loc)
SourceLocation findNullabilityLoc() const
Find the location of the nullability specifier (__nonnull, __nullable, or __null_unspecifier),...
TypeClass getTypeClass() const
void setElaboratedKeywordLoc(SourceLocation Loc)
Wrapper for source info for pointers decayed from arrays and functions.
SourceRange getLocalSourceRange() const
TagDecl * getDecl() const
bool hasWrittenWidthSpec() const
TypeLoc getModifiedLoc() const
The modified type, which is generally canonically different from the attribute type.
@ ETK_None
No keyword precedes the qualified type name.
SourceLocation getBuiltinLoc() const
SourceLocation getElaboratedKeywordLoc() const
DeclarationNameInfo getConceptNameInfo() const
void setAttrExprOperand(Expr *e)
const IdentifierInfo * getMacroIdentifier() const
void setProtocolLAngleLoc(SourceLocation Loc)
unsigned getLocalDataAlignment() const
Returns the alignment of the type source info data block that is specific to this type.
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
void * getOpaqueData() const
Retrieve the opaque pointer that refers to source-location data.
SourceLocation getRAngleLoc() const
SourceLocation getRBracketLoc() const
Represents a C++ struct/union/class.
Expr * getSizeExpr() const
void setClassTInfo(TypeSourceInfo *TI)
void setTemplateNameLoc(SourceLocation Loc)
RecordDecl * getDecl() const
void setConceptNameLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
Get the local source range.
void setTypeofLoc(SourceLocation Loc)
Wrapper for substituted template type parameters.
unsigned getExtraLocalDataAlignment() const
NestedNameSpecifierLoc NestedNameSpec
TypeLoc getNamedTypeLoc() const
Wrapper for source info for tag types.
unsigned getFullDataSize() const
Returns the size of the type source info data block.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
A metaprogramming base class for TypeLoc classes which correspond to a particular Type subclass.
T getAsAdjusted() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
void setWrittenSignSpec(TypeSpecifierSign written)
TypedefNameDecl * getDecl() const
SourceLocation getRParenLoc() const
SourceLocation getTemplateKWLoc() const
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
SourceRange getLocalSourceRange() const
QualType getNamedType() const
Retrieve the type named by the qualified-id.
A reasonable base class for TypeLocs that correspond to types that are written as a type-specifier.
Wrapper for source info for unresolved typename using decls.
QualType getWrappedType() const
void setDecltypeLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getTemplateNameLoc() const
SourceRange getLocalSourceRange() const
void setParam(unsigned i, ParmVarDecl *VD)
void setSizeExpr(Expr *Size)
Expr * getUnderlyingExpr() const
void setExpansionLoc(SourceLocation Loc)
Wrapper for source info for enum types.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
SourceLocation ExpansionLoc
void setElaboratedKeywordLoc(SourceLocation Loc)
unsigned getNumArgs() const
QualType getInnerType() const
unsigned getLocalDataSize() const
Returns the size of the type source info data block that is specific to this type.
void setEllipsisLoc(SourceLocation Loc)
Base wrapper for a particular "section" of type source info.
void setStarLoc(SourceLocation Loc)
SourceLocation getNameLoc() const
QualType getElementType() const
void setUnmodifiedTInfo(TypeSourceInfo *TI) const
QualType getType() const
Get the type for which this source info wrapper provides information.
A metaprogramming class designed for concrete subtypes of abstract types where all subtypes share equ...
SourceRange getLocalSourceRange() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
UsingShadowDecl * getFoundDecl() const
void initializeLocal(ASTContext &Context, SourceLocation loc)
TypeLoc getPatternLoc() const
unsigned getLocalDataSize() const
void setTypeArgsRAngleLoc(SourceLocation Loc)
void setKWLoc(SourceLocation Loc)
Wrapper for template type parameters.
SourceLocation DecltypeLoc
SourceLocation getDecltypeLoc() const
void initializeLocal(ASTContext &Context, SourceLocation loc)
SourceLocation getRAngleLoc() const
ObjCProtocolDecl * getProtocol(unsigned i) const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Initializes the local data of this type source info block to provide no information.
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
SourceRange getLocalSourceRange() const
ArrayRef< TemplateArgument > template_arguments() const
void copy(AutoTypeLoc Loc)
void copy(ElaboratedTypeLoc Loc)
friend bool operator!=(const TypeLoc &LHS, const TypeLoc &RHS)
bool HasBaseTypeAsWritten
static unsigned getLocalAlignmentForType(QualType Ty)
Returns the alignment of type source info data block for the given type.
SourceLocation getNameLoc() const
TemplateTypeParmDecl * getDecl() const
One of these records is kept for each identifier that is lexed.
QualType getInnerType() const
bool isQualifier() const
Does this attribute behave like a type qualifier?
void initializeLocal(ASTContext &Context, SourceLocation Loc)
ObjCTypeParamDecl * getDecl() const
TypeSpecifierWidth
Specifies the width of a type, e.g., short, long, or long long.
void setAttrNameLoc(SourceLocation loc)
SourceRange getLocalSourceRange() const
static QualType getFromOpaquePtr(const void *Ptr)
SourceLocation getTemplateKeywordLoc() const
SourceLocation ConceptNameLoc
void setRParenLoc(SourceLocation Loc)
Represents the declaration of an Objective-C type parameter.
Wrapper for source info for arrays.
TypedefNameDecl * getTypedefNameDecl() const
unsigned getExtraLocalDataSize() const
TypeLoc getPointeeTypeLoc() const
void setRParenLoc(SourceLocation Loc)
TypeLoc IgnoreParens() const
unsigned getExtraLocalDataAlignment() const
UnresolvedUsingTypenameDecl * getDecl() const
ParmVarDecl * getParam(unsigned i) const
CXXRecordDecl * getDecl() const
void setAttrOperandParensRange(SourceRange range)
SourceLocation getRParenLoc() const
void setNameLoc(SourceLocation Loc)
SourceLocation getLParenLoc() const
TypeLoc getValueLoc() const
TypeLoc getPointeeLoc() const
SourceRange getLocalSourceRange() const
EnumDecl * getDecl() const
Expr * getAttrExprOperand() const
The attribute's expression operand, if it has one.
SourceLocation getProtocolLoc(unsigned i) const
TypeLoc getOriginalLoc() const
TypeLocClass getTypeLocClass() const
SourceLocation getLAngleLoc() const
void setRAngleLoc(SourceLocation Loc)
unsigned getExtraLocalDataAlignment() const
SourceRange getLocalSourceRange() const
void setWrittenWidthSpec(TypeSpecifierWidth written)
Wrapper for source info for builtin types.
bool hasQualifier() const
Evaluates true when this nested-name-specifier location is empty.
TypeLoc(QualType ty, void *opaqueData)
const Type * getTypePtr() const
QualType getElementType() const
SourceRange getLocalSourceRange() const
void * getExtraLocalData() const
Gets a pointer past the Info structure; useful for classes with local data that can't be captured in ...
const BTFTypeTagAttr * getAttr() const
void setAttrRowOperand(Expr *e)
void setNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
SourceLocation TypeArgsLAngleLoc
TypeLoc getInnerTypeLoc() const
Expr * getUnderlyingExpr() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
ObjCProtocolDecl * getProtocol() const
AutoTypeKeyword getAutoKeyword() const
TypeSourceInfo * getClassTInfo() const
unsigned getExtraLocalDataSize() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
unsigned getNumProtocols() const
Return the number of qualifying protocols in this type, or 0 if there are none.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
void setRBracketLoc(SourceLocation Loc)
Represents an Objective-C protocol declaration.
SourceLocation getRParenLoc() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
ParmVarDecl ** getParmArray() const
void setNameLoc(SourceLocation Loc)
bool isValid() const
Return true if this is a valid SourceLocation object.
void * QualifierData
Data associated with the nested-name-specifier location.
Attr - This represents one attribute.
A container of type source information.
QualType getReturnType() const
SourceLocation getLAngleLoc() const
void setStarLoc(SourceLocation Loc)
SourceLocation getRAngleLoc() const
SourceRange getLocalSourceRange() const
Base class for declarations which introduce a typedef-name.
TypeLoc findExplicitQualifierLoc() const
Find a type with the location of an explicit type qualifier.
ObjCProtocolDecl * getProtocol(unsigned i) const
SourceLocation getStarLoc() const
void setWrittenTypeSpec(TypeSpecifierType written)
void setNameLoc(SourceLocation Loc)
SourceLocation getRParenLoc() const
SourceRange OperandParens
TypeLoc getReturnLoc() const
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
void setProtocolRAngleLoc(SourceLocation Loc)
TemplateArgumentLoc getArgLoc(unsigned i) const
void setNameLoc(SourceLocation Loc)
UnqualTypeLoc getUnqualifiedLoc() const
SourceLocation getLBracketLoc() const
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
void setTypeArgsLAngleLoc(SourceLocation Loc)
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
RecordDecl * getDecl() const
unsigned getExtraLocalDataSize() const
TypeSourceInfo * getUnmodifiedTInfo() const
const TypeClass * getTypePtr() const
QualType getUnderlyingType() const
ObjCInterfaceDecl * getIFaceDecl() const
bool isDecltypeAuto() const
void initializeFullCopy(TypeLoc Other)
Initializes this by copying its information from another TypeLoc of the same type.
void setLParenLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
WrittenBuiltinSpecs & getWrittenBuiltinSpecs()
void initializeFullCopy(TypeLoc Other, unsigned Size)
Initializes this by copying its information from another TypeLoc of the same type.
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
SourceLocation getKWLoc() const
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type.
TypeLoc getWrappedLoc() const
ConceptDecl * getNamedConcept() const
SourceLocation TypeArgsRAngleLoc
SourceLocation NameEndLoc
SourceLocation getNameLoc() const
CXXRecordDecl * getDecl() const
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
SourceLocation getConceptNameLoc() const
QualType getElementType() const
This represents one expression.
SourceLocation getTypeofLoc() const
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
QualType getInnerType() const
unsigned getNumArgs() const
unsigned getNumTypeArgs() const
void copyLocal(Derived other)
SourceLocation getKWLoc() const
const WrittenBuiltinSpecs & getWrittenBuiltinSpecs() const
const BTFTypeTagAttr * getAttr() const
The btf_type_tag attribute.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
SourceRange getLocalSourceRange() const
QualType getModifiedType() const
void copy(DependentNameTypeLoc Loc)
QualType getInnerType() const
Represents a struct/union/class.
TypeLoc getValueLoc() const
ElaboratedTypeKeyword getKeyword() const
SourceRange getParensRange() const
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
unsigned getExtraLocalDataAlignment() const
void setLAngleLoc(SourceLocation Loc)
Location information for a TemplateArgument.
QualType getUnmodifiedType() const
QualType getOriginalType() const
Structure that packs information about the type specifiers that were written in a particular type spe...
TypeLoc getElementLoc() const
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
TypeSourceInfo * UnmodifiedTInfo
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
TypeLoc getNextTypeLoc() const
Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the TypeLoc is a PointerLoc and next Typ...
TypeSpecifierType
Specifies the kind of type.
Wrapper for source info for typedefs.
unsigned getLocalDataSize() const
unsigned getNumArgs() const
QualType getInnerType() const