14#ifndef LLVM_CLANG_AST_TYPELOC_H
15#define LLVM_CLANG_AST_TYPELOC_H
25#include "llvm/ADT/ArrayRef.h"
26#include "llvm/Support/Casting.h"
27#include "llvm/Support/Compiler.h"
28#include "llvm/Support/MathExtras.h"
41class ObjCInterfaceDecl;
42class ObjCProtocolDecl;
43class ObjCTypeParamDecl;
45class TemplateTypeParmDecl;
47class UnresolvedUsingTypenameDecl;
50#define ABSTRACT_TYPELOC(Class, Base)
51#define TYPELOC(Class, Base) \
53#include "clang/AST/TypeLocNodes.def"
63 const void *
Ty =
nullptr;
69 :
Ty(ty.getAsOpaquePtr()),
Data(opaqueData) {}
71 :
Ty(ty),
Data(opaqueData) {}
79 assert(T::isKind(*
this));
90 if (!T::isKind(*
this))
102 template <
typename T>
109#define ABSTRACT_TYPE(Class, Base)
110#define TYPE(Class, Base) \
112#include "clang/AST/TypeNodes.inc"
122 explicit operator bool()
const {
return Ty; }
161 return getLocalSourceRangeImpl(*
this);
172 return getNextTypeLocImpl(*
this);
217 initializeImpl(Context, *
this,
Loc);
244 return !(LHS == RHS);
255 static bool isKind(
const TypeLoc&) {
259 static void initializeImpl(ASTContext &Context,
TypeLoc TL,
263 static SourceRange getLocalSourceRangeImpl(
TypeLoc TL);
266inline TypeSourceInfo::TypeSourceInfo(QualType ty,
size_t DataSize) : Ty(ty) {
268 memset(
static_cast<void *
>(
this + 1), 0, DataSize);
274 return TypeLoc(Ty,
const_cast<void*
>(
static_cast<const void*
>(
this + 1)));
285 return reinterpret_cast<const Type*
>(
Ty);
295 static bool isKind(
const TypeLoc &TL) {
313 dataInt = llvm::alignTo(dataInt, align);
349 static bool isKind(
const TypeLoc &TL) {
356 return Loc.getUnqualifiedLoc();
357 return castAs<UnqualTypeLoc>();
388template <
class Base,
class Derived,
class TypeClass,
class LocalData>
392 const Derived *asDerived()
const {
393 return static_cast<const Derived*
>(
this);
396 static bool isKind(
const TypeLoc &TL) {
401 static bool classofType(
const Type *Ty) {
402 return TypeClass::classof(Ty);
407 return std::max(
unsigned(
alignof(LocalData)),
412 unsigned size =
sizeof(LocalData);
413 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
414 size = llvm::alignTo(size, extraAlign);
415 size += asDerived()->getExtraLocalDataSize();
439 return cast<TypeClass>(Base::getTypePtr());
452 return static_cast<LocalData*
>(Base::Data);
459 unsigned size =
sizeof(LocalData);
460 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
461 size = llvm::alignTo(size, extraAlign);
462 return reinterpret_cast<char *
>(Base::Data) + size;
466 auto data =
reinterpret_cast<uintptr_t>(Base::Data);
467 data += asDerived()->getLocalDataSize();
468 data = llvm::alignTo(data, getNextTypeAlign());
469 return reinterpret_cast<void*
>(data);
480 unsigned getInnerTypeSize()
const {
484 unsigned getInnerTypeSize(HasNoInnerType _)
const {
488 unsigned getInnerTypeSize(QualType _)
const {
492 unsigned getNextTypeAlign()
const {
496 unsigned getNextTypeAlign(HasNoInnerType _)
const {
500 unsigned getNextTypeAlign(QualType
T)
const {
514template <
class Base,
class Derived,
class TypeClass>
518 static bool classofType(
const Type *Ty) {
519 return TypeClass::classof(Ty);
522 static bool isKind(
const TypeLoc &TL) {
526 static bool isKind(
const UnqualTypeLoc &TL) {
527 return Derived::classofType(TL.getTypePtr());
532 return cast<TypeClass>(Base::getTypePtr());
571 static bool isKind(
const TypeLoc &TL);
595 BuiltinRange =
Range;
613 return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128) ||
614 (bk >= BuiltinType::Short && bk <= BuiltinType::Ibm128) ||
615 bk == BuiltinType::UChar || bk == BuiltinType::SChar;
706 QualifierData(QualifierLoc.getOpaqueData()) {}
712 QualifierData(getTrivialQualifierData(Context, Qualifier,
Loc)) {}
715 assert(!Qualifier == !QualifierData);
723 BeginLoc = QualifierLoc.getBeginLoc();
732 static void *getTrivialQualifierData(
ASTContext &Context,
738 Builder.MakeTrivial(Context, Qualifier,
Loc);
739 return Builder.getWithLocInContext(Context).getOpaqueData();
743template <
class TL,
class T>
745 :
public ConcreteTypeLoc<UnqualTypeLoc, TL, T, ElaboratedNameLocInfo> {
752 this->getTypePtr()->getQualifier());
776 Ptr->getQualifier(),
Loc);
787 UnresolvedUsingType> {};
817 assert(!Qualifier == !QualifierData);
835 BeginLoc = Qualifier.getBeginLoc();
848 Builder.MakeTrivial(Context, Qualifier,
Loc);
879 InjectedClassNameType> {
889 TemplateTypeParmTypeLoc,
890 TemplateTypeParmType> {
902 ObjCTypeParamTypeLoc,
904 ObjCTypeParamTypeLocInfo> {
947 return getProtocolLocArray()[i];
952 getProtocolLocArray()[i] =
Loc;
988 SubstTemplateTypeParmTypeLoc,
989 SubstTemplateTypeParmType> {
1000 SubstTemplateTypeParmPackTypeLoc,
1001 SubstTemplateTypeParmPackType> {};
1006 SubstBuiltinTemplatePackTypeLoc,
1007 SubstBuiltinTemplatePackType> {};
1017 AttributedLocInfo> {
1048 return dyn_cast_or_null<T>(
getAttr());
1067 BTFTagAttributedType, BTFTagAttributedLocInfo> {
1075 return dyn_cast_or_null<T>(
getAttr());
1092 :
public ConcreteTypeLoc<UnqualTypeLoc, HLSLAttributedResourceTypeLoc,
1093 HLSLAttributedResourceType,
1094 HLSLAttributedResourceLocInfo> {
1122 HLSLInlineSpirvType, HLSLInlineSpirvTypeLocInfo> {
1151 ObjCObjectTypeLocInfo> {
1186 return getTypeArgLocArray()[i];
1191 getTypeArgLocArray()[i] = TInfo;
1216 return getProtocolLocArray()[i];
1221 getProtocolLocArray()[i] =
Loc;
1265 "not enough alignment for tail-allocated data");
1281 ObjCInterfaceTypeLoc,
1283 ObjCInterfaceLocInfo> {
1318 BoundsAttributedType, BoundsAttributedLocInfo> {
1331 CountAttributedTypeLoc,
1332 CountAttributedType> {
1347 MacroQualifiedType, MacroQualifiedLocInfo> {
1418 if (ParenTypeLoc::isKind(*
this))
1419 return IgnoreParensImpl(*
this);
1426 AdjustedType, AdjustedLocInfo> {
1454 AdjustedTypeLoc, DecayedTypeLoc, DecayedType> {
1462template <
class Derived,
class TypeClass,
class LocalData = Po
interLikeLocInfo>
1464 TypeClass, LocalData> {
1524 MemberPointerLocInfo> {
1542 "Inconsistent nested-name-specifier pointer");
1550 Builder.MakeTrivial(Context, Qualifier,
Loc);
1566 ObjCObjectPointerType> {
1581 return getTypePtr()->getPointeeTypeAsWritten();
1587 LValueReferenceTypeLoc,
1588 LValueReferenceType> {
1601 RValueReferenceTypeLoc,
1602 RValueReferenceType> {
1625 bool hasExceptionSpec()
const {
1626 if (
auto *FPT = dyn_cast<FunctionProtoType>(
getTypePtr())) {
1627 return FPT->hasExceptionSpec();
1633 assert(hasExceptionSpec() &&
"No exception spec range");
1677 if (hasExceptionSpec())
1678 return *getExceptionSpecRangePtr();
1683 if (hasExceptionSpec())
1684 *getExceptionSpecRangePtr() = R;
1699 return cast<FunctionProtoType>(
getTypePtr())->getNumParams();
1720 if (hasExceptionSpec())
1727 unsigned ExceptSpecSize = hasExceptionSpec() ?
sizeof(
SourceRange) : 0;
1738 FunctionProtoTypeLoc,
1739 FunctionProtoType> {
1744 FunctionNoProtoTypeLoc,
1745 FunctionNoProtoType> {
1806 ConstantArrayTypeLoc,
1807 ConstantArrayType> {
1813 ConstantArrayTypeLoc, ArrayParameterTypeLoc, ArrayParameterType> {};
1817 IncompleteArrayTypeLoc,
1818 IncompleteArrayType> {
1823 DependentSizedArrayTypeLoc,
1824 DependentSizedArrayType> {
1834 VariableArrayTypeLoc,
1835 VariableArrayType> {
1853 TemplateSpecializationTypeLoc,
1854 TemplateSpecializationType,
1855 TemplateSpecializationLocInfo> {
1877 assert(Qualifier &&
"missing qualification");
1907 assert(size ==
Loc.getFullDataSize());
1947 DependentAddressSpaceTypeLoc,
1948 DependentAddressSpaceType,
1949 DependentAddressSpaceLocInfo> {
2021 VectorType, VectorTypeLocInfo> {
2044 DependentVectorType, VectorTypeLocInfo> {
2071 :
public ConcreteTypeLoc<UnqualTypeLoc, DependentSizedExtVectorTypeLoc,
2072 DependentSizedExtVectorType, VectorTypeLocInfo> {
2099 MatrixType, MatrixTypeLocInfo> {
2146 ConstantMatrixType> {};
2150 DependentSizedMatrixTypeLoc,
2151 DependentSizedMatrixType> {};
2172template <
class Derived,
class TypeClass,
class LocalData = TypeofLocInfo>
2174 :
public ConcreteTypeLoc<UnqualTypeLoc, Derived, TypeClass, LocalData> {
2222 TypeOfExprTypeLocInfo> {
2238 return this->
getTypePtr()->getUnmodifiedType();
2262 :
public ConcreteTypeLoc<UnqualTypeLoc, DecltypeTypeLoc, DecltypeType,
2263 DecltypeTypeLocInfo> {
2289 PackIndexingType, PackIndexingTypeLocInfo> {
2319 UnaryTransformTypeLoc,
2321 UnaryTransformTypeLocInfo> {
2393 return CR->getNestedNameSpecifierLoc();
2399 return CR->getTemplateKWLoc();
2405 return CR->getConceptNameLoc();
2411 return CR->getFoundDecl();
2417 return CR->getNamedConcept();
2429 ->getTemplateArgsAsWritten()
2436 if (
const auto *TAAW = CR->getTemplateArgsAsWritten())
2437 return TAAW->getLAngleLoc();
2443 if (
const auto *TAAW = CR->getTemplateArgsAsWritten())
2444 return TAAW->getRAngleLoc();
2454 assert(CR &&
"No ConceptReference");
2455 return CR->getTemplateArgsAsWritten()->getTemplateArgs()[i];
2470 assert(size ==
Loc.getFullDataSize());
2485 DeducedTemplateSpecializationTypeLoc,
2486 DeducedTemplateSpecializationType,
2487 DeducedTemplateSpecializationLocInfo> {
2507 assert(Qualifier &&
"missing qualification");
2512 if (!QualifierLoc) {
2522 getTypePtr()->getTemplateName().getQualifier() &&
2523 "Inconsistent nested-name-specifier pointer");
2553 DependentNameTypeLoc,
2555 DependentNameLocInfo> {
2573 "Inconsistent nested-name-specifier pointer");
2594 assert(size ==
Loc.getFullDataSize());
2610 DependentTemplateSpecializationTypeLoc,
2611 DependentTemplateSpecializationType,
2612 DependentTemplateSpecializationLocInfo> {
2627 getTypePtr()->getDependentTemplateName().getQualifier(),
2632 if (!QualifierLoc) {
2642 getTypePtr()->getDependentTemplateName().getQualifier() &&
2643 "Inconsistent nested-name-specifier pointer");
2684 getArgInfos()[i] = AI;
2688 return getArgInfos()[i];
2709 assert(size ==
Loc.getFullDataSize());
2735 PackExpansionType, PackExpansionTypeLocInfo> {
2767 AtomicType, AtomicTypeLocInfo> {
2842template <
typename T>
2845 while (!T::isKind(Cur)) {
2847 Cur = PTL.getInnerLoc();
2849 Cur = ATL.getModifiedLoc();
2851 Cur = ATL.getWrappedLoc();
2853 Cur = ATL.getWrappedLoc();
2855 Cur = ATL.getOriginalLoc();
2857 Cur = MQL.getInnerLoc();
2868 DependentBitIntType> {};
2876 : Protocol(protocol),
Loc(loc) {}
2890 PredefinedSugarType, PredefinedSugarTypeLocInfo> {
This file provides AST data structures related to concepts.
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 array parameter types.
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.
TypeLoc getEquivalentTypeLoc() const
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
SourceLocation getTemplateKWLoc() const
AutoTypeKeyword getAutoKeyword() const
const NestedNameSpecifierLoc getNestedNameSpecifierLoc() const
SourceLocation getRAngleLoc() const
SourceLocation getRParenLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceRange getLocalSourceRange() const
void copy(AutoTypeLoc Loc)
SourceLocation getLAngleLoc() const
void setConceptReference(ConceptReference *CR)
SourceLocation getConceptNameLoc() const
NamedDecl * getFoundDecl() const
TemplateArgumentLoc getArgLoc(unsigned i) const
bool isDecltypeAuto() const
bool isConstrained() const
unsigned getNumArgs() const
TemplateDecl * getNamedConcept() const
ConceptReference * getConceptReference() const
DeclarationNameInfo getConceptNameInfo() const
void setRParenLoc(SourceLocation Loc)
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
bool isDecltypeAuto() 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)
QualType getInnerType() const
unsigned getLocalDataSize() const
TypeLoc getInnerLoc() const
void initializeLocal(ASTContext &Context, 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.
A reference to a concept and its template args, as it appears in the code.
const DeclarationNameInfo & getConceptNameInfo() const
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
Expr * getCountExpr() const
bool isCountInBytes() const
SourceRange getLocalSourceRange() const
bool isCountInBytes() const
Expr * getCountExpr() 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
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
void setElaboratedKeywordLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getElaboratedKeywordLoc() const
SourceLocation getTemplateNameLoc() const
void setTemplateNameLoc(SourceLocation Loc)
NestedNameSpecifierLoc getQualifierLoc() const
SourceRange getLocalSourceRange() const
TemplateName getTemplateName() const
Retrieve the name of the template that we are deducing.
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
SourceRange getLocalSourceRange() const
void set(SourceLocation ElaboratedKeywordLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation NameLoc)
SourceLocation getElaboratedKeywordLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getNameLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
Wrapper for source info for enum types.
EnumDecl * getOriginalDecl() const
EnumDecl * getOriginalDecl() 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
Type source information for HLSL attributed resource type.
void initializeLocal(ASTContext &Context, SourceLocation loc)
unsigned getLocalDataSize() const
TypeLoc getWrappedLoc() const
TypeSourceInfo * getContainedTypeSourceInfo() const
void setContainedTypeSourceInfo(TypeSourceInfo *TSI) const
QualType getInnerType() const
SourceRange getLocalSourceRange() const
void setSourceRange(const SourceRange &R)
QualType getWrappedType() const
SourceRange getLocalSourceRange() const
void setSpirvTypeLoc(SourceLocation loc) const
SourceLocation getSpirvTypeLoc() const
void initializeLocal(ASTContext &Context, SourceLocation loc)
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 * getOriginalDecl() const
CXXRecordDecl * getOriginalDecl() 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)
NestedNameSpecifierLoc getQualifierLoc() const
SourceRange getLocalSourceRange() const
SourceLocation getStarLoc() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
This represents a decl that may have a name.
Class that aids in the construction of nested-name-specifiers along with source-location information ...
A C++ nested-name-specifier augmented with source location information.
NestedNameSpecifier getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
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.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
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...
SourceLocation getEllipsisLoc() const
Expr * getIndexExpr() const
TypeLoc getPatternLoc() const
QualType getPattern() const
QualType getInnerType() const
SourceRange getLocalSourceRange() const
void setEllipsisLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getPattern() const
Expr * getIndexExpr() const
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)
void initializeLocal(ASTContext &Context, SourceLocation loc)
SourceRange getLocalSourceRange() const
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 * getOriginalDecl() const
RecordDecl * getOriginalDecl() 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.
Abstract type representing delayed type pack expansions.
Wrapper for substituted template type parameters.
Wrapper for substituted template type parameters.
Represents the declaration of a struct/union/class/enum.
SourceRange getLocalSourceRange() const
SourceLocation getNameLoc() const
SourceLocation getElaboratedKeywordLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
void setNameLoc(SourceLocation Loc)
void setElaboratedKeywordLoc(SourceLocation Loc)
TagDecl * getOriginalDecl() const
bool isDefinition() const
True if the tag was defined in this type specifier.
NestedNameSpecifier getQualifier() const
TagDecl * getOriginalDecl() const
A convenient class for passing around template argument information.
Location wrapper for a TemplateArgument.
The base class of all kinds of template declarations (e.g., class, function, etc.).
NestedNameSpecifier getQualifier() const
unsigned getNumArgs() const
static void initializeArgLocs(ASTContext &Context, ArrayRef< TemplateArgument > Args, TemplateArgumentLocInfo *ArgInfos, SourceLocation Loc)
SourceLocation getLAngleLoc() const
TemplateArgumentLoc getArgLoc(unsigned i) const
SourceRange getLocalSourceRange() const
SourceLocation getRAngleLoc() const
MutableArrayRef< TemplateArgumentLocInfo > getArgLocInfos()
void set(SourceLocation ElaboratedKeywordLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKeywordLoc, SourceLocation NameLoc, SourceLocation LAngleLoc, SourceLocation RAngleLoc)
SourceLocation getTemplateNameLoc() const
void copy(TemplateSpecializationTypeLoc Loc)
unsigned getExtraLocalDataAlignment() const
SourceLocation getTemplateKeywordLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getElaboratedKeywordLoc() const
unsigned getExtraLocalDataSize() const
ArrayRef< TemplateArgument > template_arguments() const
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
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...
NestedNameSpecifierLoc getPrefix() const
If this type represents a qualified-id, this returns it's nested name specifier.
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)
SourceLocation getNonElaboratedBeginLoc() const
This returns the position of the type after any elaboration, such as the 'struct' keyword.
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.
SourceLocation getTemplateKeywordLoc() const
Get the SourceLocation of the template keyword (if any).
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.
SourceLocation getNonPrefixBeginLoc() const
This returns the position of the type after any elaboration, such as the 'struct' keyword,...
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
The base class of the type hierarchy.
TypeClass getTypeClass() const
Wrapper for source info for typedefs.
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.
Wrapper for source info for types used via transparent aliases.
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
The JSON file list parser is used to communicate input to InstallAPI.
TypeSpecifierType
Specifies the kind of type.
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
@ Keyword
The name has been typo-corrected to a keyword.
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.
const FunctionProtoType * T
@ None
The alignment was not explicit in code.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
@ None
No keyword precedes the qualified type name.
@ Other
Other implicit parameter.
__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
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
SourceLocation DecltypeLoc
void * QualifierData
Data associated with the nested-name-specifier location.
SourceLocation ElaboratedKWLoc
SourceRange OperandParens
SourceLocation TemplateKWLoc
SourceLocation ElaboratedKWLoc
void * QualifierData
Data associated with the nested-name-specifier location.
ElaboratedNameLocInfo(SourceLocation ElaboratedKeywordLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation NameLoc)
ElaboratedNameLocInfo()=default
SourceLocation ElaboratedKeywordLoc
SourceRange getLocalSourceRange(NestedNameSpecifier Qualifier) const
ElaboratedNameLocInfo(ASTContext &Context, ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, SourceLocation Loc)
NestedNameSpecifierLoc getQualifierLoc(NestedNameSpecifier Qualifier) const
SourceLocation LocalRangeEnd
SourceLocation LocalRangeBegin
TypeSourceInfo * ContainedTyInfo
SourceLocation ExpansionLoc
SourceRange OperandParens
SourceLocation NameEndLoc
SourceLocation TypeArgsLAngleLoc
SourceLocation ProtocolLAngleLoc
SourceLocation TypeArgsRAngleLoc
bool HasBaseTypeAsWritten
SourceLocation ProtocolRAngleLoc
SourceLocation EllipsisLoc
SourceLocation EllipsisLoc
SourceLocation ElaboratedKWLoc
Location information for a TemplateArgument.
SourceLocation ElaboratedKWLoc
SourceLocation TemplateKWLoc
TypeSourceInfo * UnmodifiedTInfo
Structure that packs information about the type specifiers that were written in a particular type spe...