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"
40class ObjCInterfaceDecl;
41class ObjCProtocolDecl;
42class ObjCTypeParamDecl;
44class TemplateTypeParmDecl;
46class 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);
243inline TypeSourceInfo::TypeSourceInfo(QualType ty,
size_t DataSize) : Ty(ty) {
245 memset(
this + 1, 0, DataSize);
251 return TypeLoc(Ty,
const_cast<void*
>(
static_cast<const void*
>(
this + 1)));
262 return reinterpret_cast<const Type*
>(
Ty);
272 static bool isKind(
const TypeLoc &TL) {
290 dataInt = llvm::alignTo(dataInt, align);
326 static bool isKind(
const TypeLoc &TL) {
334 return castAs<UnqualTypeLoc>();
365template <
class Base,
class Derived,
class TypeClass,
class LocalData>
369 const Derived *asDerived()
const {
370 return static_cast<const Derived*
>(
this);
373 static bool isKind(
const TypeLoc &TL) {
378 static bool classofType(
const Type *Ty) {
379 return TypeClass::classof(Ty);
384 return std::max(
unsigned(
alignof(LocalData)),
389 unsigned size =
sizeof(LocalData);
390 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
391 size = llvm::alignTo(size, extraAlign);
392 size += asDerived()->getExtraLocalDataSize();
415 return cast<TypeClass>(Base::getTypePtr());
428 return static_cast<LocalData*
>(Base::Data);
435 unsigned size =
sizeof(LocalData);
436 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
437 size = llvm::alignTo(size, extraAlign);
438 return reinterpret_cast<char *
>(Base::Data) + size;
442 auto data =
reinterpret_cast<uintptr_t>(Base::Data);
443 data += asDerived()->getLocalDataSize();
444 data = llvm::alignTo(data, getNextTypeAlign());
445 return reinterpret_cast<void*
>(data);
456 unsigned getInnerTypeSize()
const {
460 unsigned getInnerTypeSize(HasNoInnerType _)
const {
464 unsigned getInnerTypeSize(QualType _)
const {
468 unsigned getNextTypeAlign()
const {
472 unsigned getNextTypeAlign(HasNoInnerType _)
const {
476 unsigned getNextTypeAlign(QualType T)
const {
490template <
class Base,
class Derived,
class TypeClass>
494 static bool classofType(
const Type *Ty) {
495 return TypeClass::classof(Ty);
498 static bool isKind(
const TypeLoc &TL) {
502 static bool isKind(
const UnqualTypeLoc &TL) {
503 return Derived::classofType(TL.getTypePtr());
508 return cast<TypeClass>(Base::getTypePtr());
547 static bool isKind(
const TypeLoc &TL);
571 BuiltinRange = Range;
574 BuiltinRange.
setEnd(std::max(Range.getEnd(), BuiltinRange.
getEnd()));
589 return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128) ||
590 (bk >= BuiltinType::Short && bk <= BuiltinType::Ibm128) ||
591 bk == BuiltinType::UChar || bk == BuiltinType::SChar;
675 UsingTypeLoc, UsingType> {
697 InjectedClassNameTypeLoc,
698 InjectedClassNameType> {
708 UnresolvedUsingTypeLoc,
709 UnresolvedUsingType> {
750 TemplateTypeParmTypeLoc,
751 TemplateTypeParmType> {
763 ObjCTypeParamTypeLoc,
765 ObjCTypeParamTypeLocInfo> {
808 return getProtocolLocArray()[i];
813 getProtocolLocArray()[i] = Loc;
849 SubstTemplateTypeParmTypeLoc,
850 SubstTemplateTypeParmType> {
856 SubstTemplateTypeParmPackTypeLoc,
857 SubstTemplateTypeParmPackType> {
895 return dyn_cast_or_null<T>(
getAttr());
914 BTFTagAttributedType, BTFTagAttributedLocInfo> {
922 return dyn_cast_or_null<T>(
getAttr());
948 ObjCObjectTypeLocInfo> {
983 return getTypeArgLocArray()[i];
988 getTypeArgLocArray()[i] = TInfo;
1013 return getProtocolLocArray()[i];
1018 getProtocolLocArray()[i] = Loc;
1062 "not enough alignment for tail-allocated data");
1078 ObjCInterfaceTypeLoc,
1080 ObjCInterfaceLocInfo> {
1118 MacroQualifiedType, MacroQualifiedLocInfo> {
1189 if (ParenTypeLoc::isKind(*
this))
1190 return IgnoreParensImpl(*
this);
1197 AdjustedType, AdjustedLocInfo> {
1225 AdjustedTypeLoc, DecayedTypeLoc, DecayedType> {
1233template <
class Derived,
class TypeClass,
class LocalData = Po
interLikeLocInfo>
1235 TypeClass, LocalData> {
1295 MemberPointerLocInfo> {
1333 ObjCObjectPointerType> {
1348 return getTypePtr()->getPointeeTypeAsWritten();
1354 LValueReferenceTypeLoc,
1355 LValueReferenceType> {
1368 RValueReferenceTypeLoc,
1369 RValueReferenceType> {
1392 bool hasExceptionSpec()
const {
1393 if (
auto *FPT = dyn_cast<FunctionProtoType>(
getTypePtr())) {
1394 return FPT->hasExceptionSpec();
1400 assert(hasExceptionSpec() &&
"No exception spec range");
1444 if (hasExceptionSpec())
1445 return *getExceptionSpecRangePtr();
1450 if (hasExceptionSpec())
1451 *getExceptionSpecRangePtr() = R;
1466 return cast<FunctionProtoType>(
getTypePtr())->getNumParams();
1487 if (hasExceptionSpec())
1494 unsigned ExceptSpecSize = hasExceptionSpec() ?
sizeof(
SourceRange) : 0;
1505 FunctionProtoTypeLoc,
1506 FunctionProtoType> {
1511 FunctionNoProtoTypeLoc,
1512 FunctionNoProtoType> {
1573 ConstantArrayTypeLoc,
1574 ConstantArrayType> {
1579 IncompleteArrayTypeLoc,
1580 IncompleteArrayType> {
1585 DependentSizedArrayTypeLoc,
1586 DependentSizedArrayType> {
1596 VariableArrayTypeLoc,
1597 VariableArrayType> {
1613 TemplateSpecializationTypeLoc,
1614 TemplateSpecializationType,
1615 TemplateSpecializationLocInfo> {
1646 getArgInfos()[i] = AI;
1650 return getArgInfos()[i];
1691 getArgInfos(), Loc);
1721 DependentAddressSpaceTypeLoc,
1722 DependentAddressSpaceType,
1723 DependentAddressSpaceLocInfo> {
1795 VectorType, VectorTypeLocInfo> {
1818 DependentVectorType, VectorTypeLocInfo> {
1845 :
public ConcreteTypeLoc<UnqualTypeLoc, DependentSizedExtVectorTypeLoc,
1846 DependentSizedExtVectorType, VectorTypeLocInfo> {
1873 MatrixType, MatrixTypeLocInfo> {
1920 ConstantMatrixType> {};
1924 DependentSizedMatrixTypeLoc,
1925 DependentSizedMatrixType> {};
1946template <
class Derived,
class TypeClass,
class LocalData = TypeofLocInfo>
1948 :
public ConcreteTypeLoc<UnqualTypeLoc, Derived, TypeClass, LocalData> {
1996 TypeOfExprTypeLocInfo> {
2012 return this->
getTypePtr()->getUnmodifiedType();
2036 :
public ConcreteTypeLoc<UnqualTypeLoc, DecltypeTypeLoc, DecltypeType,
2037 DecltypeTypeLocInfo> {
2065 UnaryTransformTypeLoc,
2067 UnaryTransformTypeLocInfo> {
2201 getArgInfos()[i] = AI;
2205 return getArgInfos()[i];
2247 DeducedTemplateSpecializationTypeLoc,
2248 DeducedTemplateSpecializationType> {
2269 ElaboratedLocInfo> {
2292 "Inconsistent nested-name-specifier pointer");
2347 DependentNameTypeLoc,
2349 DependentNameLocInfo> {
2367 "Inconsistent nested-name-specifier pointer");
2404 DependentTemplateSpecializationTypeLoc,
2405 DependentTemplateSpecializationType,
2406 DependentTemplateSpecializationLocInfo> {
2425 if (!QualifierLoc) {
2436 "Inconsistent nested-name-specifier pointer");
2477 getArgInfos()[i] = AI;
2481 return getArgInfos()[i];
2528 PackExpansionType, PackExpansionTypeLocInfo> {
2560 AtomicType, AtomicTypeLocInfo> {
2635template <
typename T>
2638 while (!T::isKind(Cur)) {
2640 Cur = PTL.getInnerLoc();
2642 Cur = ATL.getModifiedLoc();
2644 Cur = ATL.getWrappedLoc();
2646 Cur = ETL.getNamedTypeLoc();
2648 Cur = ATL.getOriginalLoc();
2650 Cur = MQL.getInnerLoc();
2654 return Cur.
getAs<T>();
2661 DependentBitIntType> {};
2669 : Protocol(protocol), Loc(loc) {}
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
__DEVICE__ void * memset(void *__a, int __b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getInnerType() const
unsigned getLocalDataSize() const
TypeLoc getOriginalLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceRange getLocalSourceRange() const
QualType getOriginalType() const
Wrapper for source info for arrays.
SourceLocation getLBracketLoc() const
Expr * getSizeExpr() const
void setLBracketLoc(SourceLocation Loc)
TypeLoc getElementLoc() const
void setRBracketLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getRBracketLoc() const
SourceRange getBracketsRange() const
SourceRange getLocalSourceRange() const
QualType getInnerType() const
void setSizeExpr(Expr *Size)
QualType getElementType() const
SourceLocation getRParenLoc() const
QualType getInnerType() const
SourceRange getLocalSourceRange() const
void setRParenLoc(SourceLocation Loc)
SourceRange getParensRange() const
TypeLoc getValueLoc() const
void setLParenLoc(SourceLocation Loc)
void setKWLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getKWLoc() const
SourceLocation getLParenLoc() const
void setParensRange(SourceRange Range)
QualType getValueType() const
Gets the type contained by this atomic type, i.e.
Attr - This represents one attribute.
Type source information for an attributed type.
const Attr * getAttr() const
The type attribute.
QualType getInnerType() const
TypeLoc getModifiedLoc() const
The modified type, which is generally canonically different from the attribute type.
void initializeLocal(ASTContext &Context, SourceLocation loc)
SourceRange getLocalSourceRange() const
void setAttr(const Attr *A)
attr::Kind getAttrKind() const
QualType getModifiedType() const
bool isQualifier() const
Does this attribute behave like a type qualifier?
bool hasExplicitTemplateArgs() const
DeclarationNameInfo getConceptNameInfo() const
SourceLocation getTemplateKWLoc() const
void setConceptNameLoc(SourceLocation Loc)
AutoTypeKeyword getAutoKeyword() const
SourceLocation getRAngleLoc() const
SourceLocation getRParenLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setFoundDecl(NamedDecl *D)
ConceptDecl * getNamedConcept() const
SourceRange getLocalSourceRange() const
void setTemplateKWLoc(SourceLocation Loc)
void copy(AutoTypeLoc Loc)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
SourceLocation getLAngleLoc() const
unsigned getExtraLocalDataAlignment() const
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
void setLAngleLoc(SourceLocation Loc)
SourceLocation getConceptNameLoc() const
NamedDecl * getFoundDecl() const
TemplateArgumentLoc getArgLoc(unsigned i) const
bool isDecltypeAuto() const
void setNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
bool isConstrained() const
unsigned getNumArgs() const
unsigned getExtraLocalDataSize() const
void setRAngleLoc(SourceLocation Loc)
void setRParenLoc(SourceLocation Loc)
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
bool isDecltypeAuto() const
ConceptDecl * getTypeConstraintConcept() const
AutoTypeKeyword getKeyword() const
bool isConstrained() const
Type source information for an btf_tag attributed type.
QualType getInnerType() const
TypeLoc getWrappedLoc() const
void initializeLocal(ASTContext &Context, SourceLocation loc)
const BTFTypeTagAttr * getAttr() const
The btf_type_tag attribute.
SourceRange getLocalSourceRange() const
const BTFTypeTagAttr * getAttr() const
QualType getWrappedType() const
Wrapper for source info for block pointers.
SourceLocation getCaretLoc() const
void setCaretLoc(SourceLocation Loc)
Wrapper for source info for builtin types.
SourceLocation getBuiltinLoc() const
TypeSpecifierType getWrittenTypeSpec() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
TypeSpecifierWidth getWrittenWidthSpec() const
SourceRange getLocalSourceRange() const
void setWrittenTypeSpec(TypeSpecifierType written)
const WrittenBuiltinSpecs & getWrittenBuiltinSpecs() const
bool needsExtraLocalData() const
bool hasWrittenWidthSpec() const
void setModeAttr(bool written)
void setBuiltinLoc(SourceLocation Loc)
void setWrittenWidthSpec(TypeSpecifierWidth written)
SourceLocation getNameLoc() const
unsigned getExtraLocalDataAlignment() const
WrittenBuiltinSpecs & getWrittenBuiltinSpecs()
void setWrittenSignSpec(TypeSpecifierSign written)
bool hasWrittenSignSpec() const
unsigned getExtraLocalDataSize() const
bool hasWrittenTypeSpec() const
TypeSpecifierSign getWrittenSignSpec() const
void expandBuiltinRange(SourceRange Range)
Represents a C++ struct/union/class.
Declaration of a C++20 concept.
A metaprogramming base class for TypeLoc classes which correspond to a particular Type subclass.
const TypeClass * getTypePtr() const
TypeLoc getInnerTypeLoc() const
unsigned getExtraLocalDataAlignment() const
HasNoInnerType getInnerType() const
void * getExtraLocalData() const
Gets a pointer past the Info structure; useful for classes with local data that can't be captured in ...
LocalData * getLocalData() const
unsigned getLocalDataAlignment() const
void * getNonLocalData() const
TypeLoc getNextTypeLoc() const
unsigned getExtraLocalDataSize() const
void copyLocal(Derived other)
unsigned getLocalDataSize() const
Wrapper for source info for pointers decayed from arrays and functions.
SourceLocation getDecltypeLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Expr * getUnderlyingExpr() const
SourceLocation getRParenLoc() const
void setRParenLoc(SourceLocation Loc)
void setDecltypeLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
Expr * getUnderlyingExpr() const
SourceLocation getTemplateNameLoc() const
void setTemplateNameLoc(SourceLocation Loc)
TypeLoc getPointeeTypeLoc() const
void setAttrNameLoc(SourceLocation loc)
SourceRange getLocalSourceRange() const
void setAttrOperandParensRange(SourceRange range)
QualType getInnerType() const
Returns the type before the address space attribute application area.
void setAttrExprOperand(Expr *e)
Expr * getAttrExprOperand() const
The attribute's expression operand, if it has one.
void initializeLocal(ASTContext &Context, SourceLocation loc)
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
QualType getPointeeType() const
void copy(DependentNameTypeLoc Loc)
NestedNameSpecifierLoc getQualifierLoc() const
SourceLocation getNameLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceRange getLocalSourceRange() const
SourceLocation getElaboratedKeywordLoc() const
void setNameLoc(SourceLocation Loc)
void setElaboratedKeywordLoc(SourceLocation Loc)
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getNameLoc() const
QualType getInnerType() const
TypeLoc getElementLoc() const
SourceRange getLocalSourceRange() const
void setNameLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getElementType() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
unsigned getNumArgs() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getTemplateNameLoc() const
SourceRange getLocalSourceRange() const
SourceLocation getLAngleLoc() const
unsigned getExtraLocalDataSize() const
void setTemplateKeywordLoc(SourceLocation Loc)
void copy(DependentTemplateSpecializationTypeLoc Loc)
SourceLocation getTemplateKeywordLoc() const
void setElaboratedKeywordLoc(SourceLocation Loc)
void setRAngleLoc(SourceLocation Loc)
TemplateArgumentLoc getArgLoc(unsigned i) const
SourceLocation getRAngleLoc() const
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
SourceLocation getElaboratedKeywordLoc() const
void setLAngleLoc(SourceLocation Loc)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
void setTemplateNameLoc(SourceLocation Loc)
NestedNameSpecifierLoc getQualifierLoc() const
unsigned getExtraLocalDataAlignment() const
ArrayRef< TemplateArgument > template_arguments() const
SourceLocation getNameLoc() const
SourceRange getLocalSourceRange() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
TypeLoc getElementLoc() const
void setNameLoc(SourceLocation Loc)
QualType getInnerType() const
QualType getElementType() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
unsigned getLocalDataAlignment() const
QualType getInnerType() const
SourceLocation getElaboratedKeywordLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
void copy(ElaboratedTypeLoc Loc)
unsigned getLocalDataSize() const
SourceRange getLocalSourceRange() const
void setElaboratedKeywordLoc(SourceLocation Loc)
TypeLoc getNamedTypeLoc() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
QualType getNamedType() const
Retrieve the type named by the qualified-id.
Wrapper for source info for enum types.
EnumDecl * getDecl() const
EnumDecl * getDecl() const
This represents one expression.
Wrapper for source info for functions.
ParmVarDecl ** getParmArray() const
QualType getInnerType() const
unsigned getNumParams() const
ParmVarDecl * getParam(unsigned i) const
SourceLocation getLocalRangeEnd() const
void setLocalRangeBegin(SourceLocation L)
void setLParenLoc(SourceLocation Loc)
SourceRange getExceptionSpecRange() const
void setParam(unsigned i, ParmVarDecl *VD)
ArrayRef< ParmVarDecl * > getParams() const
SourceRange getParensRange() const
void setRParenLoc(SourceLocation Loc)
unsigned getExtraLocalDataAlignment() const
void setLocalRangeEnd(SourceLocation L)
unsigned getExtraLocalDataSize() const
Returns the size of the type source info data block that is specific to this type.
void setExceptionSpecRange(SourceRange R)
TypeLoc getReturnLoc() const
SourceLocation getLocalRangeBegin() const
SourceRange getLocalSourceRange() const
SourceLocation getLParenLoc() const
SourceLocation getRParenLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getReturnType() const
One of these records is kept for each identifier that is lexed.
A metaprogramming class designed for concrete subtypes of abstract types where all subtypes share equ...
const TypeClass * getTypePtr() const
Wrapper for source info for injected class names of class templates.
CXXRecordDecl * getDecl() const
CXXRecordDecl * getDecl() const
void setAmpLoc(SourceLocation Loc)
SourceLocation getAmpLoc() const
const IdentifierInfo * getMacroIdentifier() const
SourceLocation getExpansionLoc() const
TypeLoc getInnerLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setExpansionLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
QualType getInnerType() const
QualType getUnderlyingType() const
const IdentifierInfo * getMacroIdentifier() const
Expr * getAttrColumnOperand() const
The attribute's column operand, if it has one.
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
void setAttrRowOperand(Expr *e)
SourceRange getLocalSourceRange() const
void setAttrColumnOperand(Expr *e)
void setAttrOperandParensRange(SourceRange range)
void setAttrNameLoc(SourceLocation loc)
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
void initializeLocal(ASTContext &Context, SourceLocation loc)
Expr * getAttrRowOperand() const
The attribute's row operand, if it has one.
Wrapper for source info for member pointers.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setStarLoc(SourceLocation Loc)
TypeSourceInfo * getClassTInfo() const
SourceRange getLocalSourceRange() const
void setClassTInfo(TypeSourceInfo *TI)
SourceLocation getStarLoc() const
const Type * getClass() const
This represents a decl that may have a name.
A C++ nested-name-specifier augmented with source location information.
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
void * getOpaqueData() const
Retrieve the opaque pointer that refers to source-location data.
bool hasQualifier() const
Evaluates true when this nested-name-specifier location is empty.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
Represents an ObjC class declaration.
Wrapper for source info for ObjC interfaces.
void setNameLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
void setNameEndLoc(SourceLocation Loc)
ObjCInterfaceDecl * getIFaceDecl() const
SourceLocation getNameEndLoc() const
SourceLocation getNameLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Wraps an ObjCPointerType with source location information.
SourceLocation getStarLoc() const
void setStarLoc(SourceLocation Loc)
unsigned getExtraLocalDataAlignment() const
void setTypeArgsRAngleLoc(SourceLocation Loc)
ObjCProtocolDecl * getProtocol(unsigned i) const
unsigned getExtraLocalDataSize() const
bool hasBaseTypeAsWritten() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getTypeArgsLAngleLoc() const
unsigned getNumTypeArgs() const
ArrayRef< SourceLocation > getProtocolLocs() const
unsigned getNumProtocols() const
void setTypeArgsLAngleLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
TypeSourceInfo * getTypeArgTInfo(unsigned i) const
void setTypeArgTInfo(unsigned i, TypeSourceInfo *TInfo)
void setProtocolLAngleLoc(SourceLocation Loc)
void setProtocolRAngleLoc(SourceLocation Loc)
SourceLocation getProtocolRAngleLoc() const
SourceLocation getProtocolLoc(unsigned i) const
void setHasBaseTypeAsWritten(bool HasBaseType)
void setProtocolLoc(unsigned i, SourceLocation Loc)
TypeLoc getBaseLoc() const
QualType getInnerType() const
SourceLocation getProtocolLAngleLoc() const
SourceLocation getTypeArgsRAngleLoc() const
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
QualType getBaseType() const
Gets the base type of this object type.
Represents an Objective-C protocol declaration.
SourceLocation getLocation() const
ObjCProtocolLoc(ObjCProtocolDecl *protocol, SourceLocation loc)
ObjCProtocolDecl * getProtocol() const
SourceRange getSourceRange() const LLVM_READONLY
The source range is just the protocol name.
unsigned getNumProtocols() const
Return the number of qualifying protocols in this type, or 0 if there are none.
qual_iterator qual_begin() const
Represents the declaration of an Objective-C type parameter.
ProtocolLAngleLoc, ProtocolRAngleLoc, and the source locations for protocol qualifiers are stored aft...
unsigned getExtraLocalDataAlignment() const
ObjCTypeParamDecl * getDecl() const
SourceRange getLocalSourceRange() const
unsigned getNumProtocols() const
SourceLocation getNameLoc() const
ObjCProtocolDecl * getProtocol(unsigned i) const
SourceLocation getProtocolLoc(unsigned i) const
ArrayRef< SourceLocation > getProtocolLocs() const
void setProtocolLoc(unsigned i, SourceLocation Loc)
void setProtocolLAngleLoc(SourceLocation Loc)
unsigned getExtraLocalDataSize() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getProtocolLAngleLoc() const
void setProtocolRAngleLoc(SourceLocation Loc)
void setNameLoc(SourceLocation Loc)
SourceLocation getProtocolRAngleLoc() const
ObjCTypeParamDecl * getDecl() const
SourceRange getLocalSourceRange() const
void setEllipsisLoc(SourceLocation Loc)
SourceLocation getEllipsisLoc() const
TypeLoc getPatternLoc() const
QualType getInnerType() 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...
void setRParenLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getRParenLoc() const
QualType getInnerType() const
SourceLocation getLParenLoc() const
SourceRange getLocalSourceRange() const
TypeLoc getInnerLoc() const
void setLParenLoc(SourceLocation Loc)
QualType getInnerType() const
Represents a parameter to a function.
TypeLoc getValueLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getInnerType() const
void setKWLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
SourceLocation getKWLoc() const
QualType getElementType() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceRange getLocalSourceRange() const
void setSigilLoc(SourceLocation Loc)
QualType getInnerType() const
TypeLoc getPointeeLoc() const
SourceLocation getSigilLoc() const
Wrapper for source info for pointers.
SourceLocation getStarLoc() const
void setStarLoc(SourceLocation Loc)
A (possibly-)qualified type.
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
static QualType getFromOpaquePtr(const void *Ptr)
Wrapper of type source information for a type with non-trivial direct qualifiers.
TypeLoc getNextTypeLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Initializes the local data of this type source info block to provide no information.
unsigned getLocalDataSize() const
Returns the size of the type source info data block that is specific to this type.
unsigned getLocalDataAlignment() const
Returns the alignment of the type source info data block that is specific to this type.
void copyLocal(TypeLoc other)
SourceRange getLocalSourceRange() const
UnqualTypeLoc getUnqualifiedLoc() const
void setAmpAmpLoc(SourceLocation Loc)
SourceLocation getAmpAmpLoc() const
Represents a struct/union/class.
Wrapper for source info for record types.
RecordDecl * getDecl() const
RecordDecl * getDecl() const
QualType getInnerType() const
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
void setBegin(SourceLocation b)
SourceLocation getEnd() const
SourceLocation getBegin() const
void setEnd(SourceLocation e)
Wrapper for substituted template type parameters.
Wrapper for substituted template type parameters.
Represents the declaration of a struct/union/class/enum.
Wrapper for source info for tag types.
TagDecl * getDecl() const
bool isDefinition() const
True if the tag was defined in this type specifier.
TagDecl * getDecl() const
Location wrapper for a TemplateArgument.
unsigned getNumArgs() const
static void initializeArgLocs(ASTContext &Context, ArrayRef< TemplateArgument > Args, TemplateArgumentLocInfo *ArgInfos, SourceLocation Loc)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
SourceLocation getLAngleLoc() const
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
void setTemplateKeywordLoc(SourceLocation Loc)
TemplateArgumentLoc getArgLoc(unsigned i) const
SourceRange getLocalSourceRange() const
SourceLocation getRAngleLoc() const
void setTemplateNameLoc(SourceLocation Loc)
void setLAngleLoc(SourceLocation Loc)
SourceLocation getTemplateNameLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void copy(TemplateSpecializationTypeLoc Loc)
unsigned getExtraLocalDataAlignment() const
SourceLocation getTemplateKeywordLoc() const
void setRAngleLoc(SourceLocation Loc)
unsigned getExtraLocalDataSize() const
ArrayRef< TemplateArgument > template_arguments() const
Declaration of a template type parameter.
Wrapper for template type parameters.
TemplateTypeParmDecl * getDecl() const
TemplateTypeParmDecl * getDecl() const
Base wrapper for a particular "section" of type source info.
SourceLocation findNullabilityLoc() const
Find the location of the nullability specifier (__nonnull, __nullable, or __null_unspecifier),...
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
static unsigned getLocalAlignmentForType(QualType Ty)
Returns the alignment of type source info data block for the given type.
TypeLoc findExplicitQualifierLoc() const
Find a type with the location of an explicit type qualifier.
QualType getType() const
Get the type for which this source info wrapper provides information.
TypeLoc getNextTypeLoc() const
Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the TypeLoc is a PointerLoc and next Typ...
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
friend bool operator==(const TypeLoc &LHS, const TypeLoc &RHS)
TypeLoc IgnoreParens() const
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type.
TypeLoc(QualType ty, void *opaqueData)
void initializeFullCopy(TypeLoc Other)
Initializes this by copying its information from another TypeLoc of the same type.
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
SourceRange getLocalSourceRange() const
Get the local source range.
void initializeFullCopy(TypeLoc Other, unsigned Size)
Initializes this by copying its information from another TypeLoc of the same type.
unsigned getFullDataSize() const
Returns the size of the type source info data block.
AutoTypeLoc getContainedAutoTypeLoc() const
Get the typeloc of an AutoType whose type will be deduced for a variable with an initializer of this ...
TypeLoc(const Type *ty, void *opaqueData)
void * getOpaqueData() const
Get the pointer where source information is stored.
TypeLocClass
The kinds of TypeLocs.
void copy(TypeLoc other)
Copies the other type loc into this one.
TypeLocClass getTypeLocClass() const
static unsigned getFullDataSizeForType(QualType Ty)
Returns the size of type source info data block for the given type.
void initialize(ASTContext &Context, SourceLocation Loc) const
Initializes this to state that every location in this type is the given location.
SourceLocation getEndLoc() const
Get the end source location.
T getAsAdjusted() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
friend bool operator!=(const TypeLoc &LHS, const TypeLoc &RHS)
SourceLocation getBeginLoc() const
Get the begin source location.
const Type * getTypePtr() const
SourceRange getLocalSourceRange() const
Expr * getUnderlyingExpr() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setUnmodifiedTInfo(TypeSourceInfo *TI) const
TypeSourceInfo * getUnmodifiedTInfo() const
QualType getUnmodifiedType() const
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
A reasonable base class for TypeLocs that correspond to types that are written as a type-specifier.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getNameLoc() const
void setNameLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
ElaboratedTypeKeyword getKeyword() const
The base class of the type hierarchy.
TypeClass getTypeClass() const
Base class for declarations which introduce a typedef-name.
Wrapper for source info for typedefs.
TypedefNameDecl * getTypedefNameDecl() const
TypedefNameDecl * getDecl() const
void setParensRange(SourceRange range)
SourceRange getLocalSourceRange() const
SourceLocation getLParenLoc() const
SourceLocation getRParenLoc() const
SourceRange getParensRange() const
void setLParenLoc(SourceLocation Loc)
SourceLocation getTypeofLoc() const
void setTypeofLoc(SourceLocation Loc)
void setRParenLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Wrapper of type source information for a type with no direct qualifiers.
TypeLocClass getTypeLocClass() const
UnqualTypeLoc(const Type *Ty, void *Data)
const Type * getTypePtr() const
Wrapper for source info for unresolved typename using decls.
UnresolvedUsingTypenameDecl * getDecl() const
UnresolvedUsingTypenameDecl * getDecl() const
Represents a dependent using declaration which was marked with typename.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Wrapper for source info for types used via transparent aliases.
QualType getUnderlyingType() const
UsingShadowDecl * getFoundDecl() const
UsingShadowDecl * getFoundDecl() const
QualType getUnderlyingType() const
TypeLoc getElementLoc() const
void setNameLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceRange getLocalSourceRange() const
QualType getInnerType() const
SourceLocation getNameLoc() const
QualType getElementType() const
TypeSpecifierType
Specifies the kind of type.
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
TypeSpecifierWidth
Specifies the width of a type, e.g., short, long, or long long.
TypeSpecifierSign
Specifies the signedness of a type, e.g., signed or unsigned.
@ ETK_None
No keyword precedes the qualified type name.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
SourceLocation LBracketLoc
SourceLocation RBracketLoc
SourceLocation TemplateKWLoc
NestedNameSpecifierLoc NestedNameSpec
SourceLocation ConceptNameLoc
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
SourceLocation DecltypeLoc
SourceRange OperandParens
SourceLocation TemplateKWLoc
SourceLocation ElaboratedKWLoc
void * QualifierData
Data associated with the nested-name-specifier location.
SourceLocation LocalRangeEnd
SourceLocation LocalRangeBegin
SourceLocation ExpansionLoc
SourceRange OperandParens
TypeSourceInfo * ClassTInfo
SourceLocation NameEndLoc
SourceLocation TypeArgsLAngleLoc
SourceLocation ProtocolLAngleLoc
SourceLocation TypeArgsRAngleLoc
bool HasBaseTypeAsWritten
SourceLocation ProtocolRAngleLoc
SourceLocation EllipsisLoc
Location information for a TemplateArgument.
SourceLocation TemplateKWLoc
TypeSourceInfo * UnmodifiedTInfo
Structure that packs information about the type specifiers that were written in a particular type spe...