15 #ifndef LLVM_CLANG_AST_TYPELOC_H
16 #define LLVM_CLANG_AST_TYPELOC_H
22 #include "llvm/Support/Compiler.h"
31 #define ABSTRACT_TYPELOC(Class, Base)
32 #define TYPELOC(Class, Base) \
34 #include "clang/AST/TypeLocNodes.def"
54 assert(T::isKind(*
this));
65 if (!T::isKind(*
this))
77 #define ABSTRACT_TYPE(Class, Base)
78 #define TYPE(Class, Base) \
80 #include "clang/AST/TypeNodes.def"
86 :
Ty(ty.getAsOpaquePtr()),
Data(opaqueData) { }
88 :
Ty(ty),
Data(opaqueData) { }
96 explicit operator bool()
const {
return Ty; }
135 return getLocalSourceRangeImpl(*
this);
146 return getNextTypeLocImpl(*
this);
160 initializeImpl(Context, *
this, Loc);
188 return !(LHS == RHS);
196 static bool isKind(
const TypeLoc&) {
204 static SourceRange getLocalSourceRangeImpl(
TypeLoc TL);
209 return TypeLoc(Ty, const_cast<void*>(static_cast<const void*>(
this + 1)));
220 return reinterpret_cast<const Type*
>(
Ty);
229 static bool isKind(
const TypeLoc &TL) {
248 uintptr_t dataInt =
reinterpret_cast<uintptr_t
>(
Data);
249 dataInt = llvm::RoundUpToAlignment(dataInt, align);
284 static bool isKind(
const TypeLoc &TL) {
292 return castAs<UnqualTypeLoc>();
323 template <
class Base,
class Derived,
class TypeClass,
class LocalData>
326 const Derived *asDerived()
const {
327 return static_cast<const Derived*
>(
this);
331 static bool isKind(
const TypeLoc &TL) {
336 static bool classofType(
const Type *Ty) {
342 return std::max(llvm::alignOf<LocalData>(),
346 unsigned size =
sizeof(LocalData);
347 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
348 size = llvm::RoundUpToAlignment(size, extraAlign);
349 size += asDerived()->getExtraLocalDataSize();
358 memcpy(
getLocalData(), other.getLocalData(),
sizeof(LocalData));
364 asDerived()->getExtraLocalDataSize());
372 return cast<TypeClass>(Base::getTypePtr());
385 return static_cast<LocalData*
>(Base::Data);
392 unsigned size =
sizeof(LocalData);
393 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
394 size = llvm::RoundUpToAlignment(size, extraAlign);
395 return reinterpret_cast<char*
>(Base::Data) + size;
399 uintptr_t data =
reinterpret_cast<uintptr_t
>(Base::Data);
400 data += asDerived()->getLocalDataSize();
401 data = llvm::RoundUpToAlignment(data, getNextTypeAlign());
402 return reinterpret_cast<void*
>(data);
413 unsigned getInnerTypeSize()
const {
417 unsigned getInnerTypeSize(HasNoInnerType _)
const {
421 unsigned getInnerTypeSize(QualType _)
const {
425 unsigned getNextTypeAlign()
const {
429 unsigned getNextTypeAlign(HasNoInnerType _)
const {
433 unsigned getNextTypeAlign(QualType T)
const {
449 template <
class Base,
class Derived,
class TypeClass>
452 static bool classofType(
const Type *Ty) {
456 static bool isKind(
const TypeLoc &TL) {
460 static bool isKind(
const UnqualTypeLoc &TL) {
461 return Derived::classofType(TL.getTypePtr());
466 return cast<TypeClass>(Base::getTypePtr());
500 static bool isKind(
const TypeLoc &TL);
532 return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128)
533 || (bk >= BuiltinType::Short && bk <= BuiltinType::LongDouble)
534 || bk == BuiltinType::UChar
535 || bk == BuiltinType::SChar;
543 return needsExtraLocalData() ? llvm::alignOf<WrittenBuiltinSpecs>() : 1;
547 return SourceRange(getBuiltinLoc(), getBuiltinLoc());
551 if (needsExtraLocalData())
560 if (needsExtraLocalData())
561 getWrittenBuiltinSpecs().Sign = written;
565 if (needsExtraLocalData())
574 if (needsExtraLocalData())
575 getWrittenBuiltinSpecs().Width = written;
583 if (needsExtraLocalData())
584 getWrittenBuiltinSpecs().Type = written;
588 if (needsExtraLocalData())
589 return getWrittenBuiltinSpecs().ModeAttr;
594 if (needsExtraLocalData())
595 getWrittenBuiltinSpecs().ModeAttr = written;
600 if (needsExtraLocalData()) {
625 InjectedClassNameTypeLoc,
626 InjectedClassNameType> {
636 UnresolvedUsingTypeLoc,
637 UnresolvedUsingType> {
682 TemplateTypeParmTypeLoc,
683 TemplateTypeParmType> {
691 SubstTemplateTypeParmTypeLoc,
692 SubstTemplateTypeParmType> {
698 SubstTemplateTypeParmPackTypeLoc,
699 SubstTemplateTypeParmPackType> {
736 return hasAttrExprOperand() || hasAttrEnumOperand();
743 TypeLoc getModifiedLoc()
const {
750 SourceLocation getAttrNameLoc()
const {
753 void setAttrNameLoc(SourceLocation loc) {
760 Expr *getAttrExprOperand()
const {
761 assert(hasAttrExprOperand());
764 void setAttrExprOperand(Expr *e) {
765 assert(hasAttrExprOperand());
773 assert(hasAttrEnumOperand());
777 assert(hasAttrEnumOperand());
786 assert(hasAttrOperand());
790 assert(hasAttrOperand());
805 if (hasAttrOperand())
806 range.
setEnd(getAttrOperandParensRange().getEnd());
812 if (hasAttrExprOperand()) {
814 setAttrExprOperand(
nullptr);
815 }
else if (hasAttrEnumOperand()) {
817 setAttrEnumOperandLoc(loc);
843 ObjCObjectTypeLocInfo> {
852 return (
SourceLocation*)(getTypeArgLocArray() + getNumTypeArgs());
871 return this->
getTypePtr()->getTypeArgsAsWritten().size();
875 assert(i < getNumTypeArgs() &&
"Index is out of bounds!");
876 return getTypeArgLocArray()[i];
880 assert(i < getNumTypeArgs() &&
"Index is out of bounds!");
881 getTypeArgLocArray()[i] = TInfo;
903 assert(i < getNumProtocols() &&
"Index is out of bounds!");
904 return getProtocolLocArray()[i];
907 assert(i < getNumProtocols() &&
"Index is out of bounds!");
908 getProtocolLocArray()[i] = Loc;
912 assert(i < getNumProtocols() &&
"Index is out of bounds!");
913 return *(this->
getTypePtr()->qual_begin() + i);
918 return llvm::makeArrayRef(getProtocolLocArray(), getNumProtocols());
936 start = getProtocolLAngleLoc();
939 end = getTypeArgsRAngleLoc();
951 assert(llvm::alignOf<ObjCObjectTypeLoc>()
952 >= llvm::alignOf<TypeSourceInfo *>() &&
953 "not enough alignment for tail-allocated data");
954 return llvm::alignOf<TypeSourceInfo *>();
970 ObjCInterfaceTypeLoc,
972 ObjCInterfaceLocInfo> {
1027 return SourceRange(getLParenLoc(), getRParenLoc());
1045 if (ParenTypeLoc::isKind(*
this))
1046 return IgnoreParensImpl(*
this);
1054 AdjustedType, AdjustedLocInfo> {
1084 AdjustedTypeLoc, DecayedTypeLoc, DecayedType> {
1092 template <
class Derived,
class TypeClass,
class LocalData = Po
interLikeLocInfo>
1094 TypeClass, LocalData> {
1126 return getSigilLoc();
1139 return getSigilLoc();
1153 MemberPointerLocInfo> {
1156 return getSigilLoc();
1174 setClassTInfo(
nullptr);
1179 return SourceRange(TI->getTypeLoc().getBeginLoc(), getStarLoc());
1188 ObjCObjectPointerType> {
1191 return getSigilLoc();
1204 return getTypePtr()->getPointeeTypeAsWritten();
1210 LValueReferenceTypeLoc,
1211 LValueReferenceType> {
1214 return getSigilLoc();
1223 RValueReferenceTypeLoc,
1224 RValueReferenceType> {
1227 return getSigilLoc();
1277 return SourceRange(getLParenLoc(), getRParenLoc());
1281 return llvm::makeArrayRef(getParmArray(), getNumParams());
1292 return cast<FunctionProtoType>(
getTypePtr())->getNumParams();
1302 return SourceRange(getLocalRangeBegin(), getLocalRangeEnd());
1306 setLocalRangeBegin(Loc);
1309 setLocalRangeEnd(Loc);
1310 for (
unsigned i = 0, e = getNumParams(); i != e; ++i)
1311 setParam(i,
nullptr);
1321 return llvm::alignOf<ParmVarDecl*>();
1329 FunctionProtoTypeLoc,
1330 FunctionProtoType> {
1335 FunctionNoProtoTypeLoc,
1336 FunctionNoProtoType> {
1366 return SourceRange(getLBracketLoc(), getRBracketLoc());
1381 return SourceRange(getLBracketLoc(), getRBracketLoc());
1385 setLBracketLoc(Loc);
1386 setRBracketLoc(Loc);
1387 setSizeExpr(
nullptr);
1395 ConstantArrayTypeLoc,
1396 ConstantArrayType> {
1401 IncompleteArrayTypeLoc,
1402 IncompleteArrayType> {
1407 DependentSizedArrayTypeLoc,
1408 DependentSizedArrayType> {
1414 VariableArrayTypeLoc,
1415 VariableArrayType> {
1432 TemplateSpecializationTypeLoc,
1433 TemplateSpecializationType,
1434 TemplateSpecializationLocInfo> {
1461 getArgInfos()[i] = AI;
1464 return getArgInfos()[i];
1491 if (getTemplateKeywordLoc().isValid())
1492 return SourceRange(getTemplateKeywordLoc(), getRAngleLoc());
1494 return SourceRange(getTemplateNameLoc(), getRAngleLoc());
1498 setTemplateKeywordLoc(Loc);
1499 setTemplateNameLoc(Loc);
1502 initializeArgLocs(Context, getNumArgs(),
getTypePtr()->getArgs(),
1503 getArgInfos(), Loc);
1516 return llvm::alignOf<TemplateArgumentLocInfo>();
1548 DependentSizedExtVectorTypeLoc,
1549 DependentSizedExtVectorType> {
1571 template <
class Derived,
class TypeClass,
class LocalData = TypeofLocInfo>
1573 :
public ConcreteTypeLoc<UnqualTypeLoc, Derived, TypeClass, LocalData> {
1597 return SourceRange(getLParenLoc(), getRParenLoc());
1601 setRParenLoc(range.
getEnd());
1605 return SourceRange(getTypeofLoc(), getRParenLoc());
1617 TypeOfExprTypeLocInfo> {
1632 return this->
getTypePtr()->getUnderlyingType();
1660 UnaryTransformTypeLoc,
1662 UnaryTransformTypeLocInfo> {
1685 return SourceRange(getLParenLoc(), getRParenLoc());
1689 setRParenLoc(Range.
getEnd());
1713 ElaboratedLocInfo> {
1730 "Inconsistent nested-name-specifier pointer");
1735 if (getElaboratedKeywordLoc().isValid())
1736 if (getQualifierLoc())
1742 return getQualifierLoc().getSourceRange();
1769 DependentNameTypeLoc,
1771 DependentNameLocInfo> {
1788 "Inconsistent nested-name-specifier pointer");
1800 if (getElaboratedKeywordLoc().isValid())
1824 DependentTemplateSpecializationTypeLoc,
1825 DependentTemplateSpecializationType,
1826 DependentTemplateSpecializationLocInfo> {
1844 if (!QualifierLoc) {
1855 "Inconsistent nested-name-specifier pointer");
1892 getArgInfos()[i] = AI;
1895 return getArgInfos()[i];
1903 if (getElaboratedKeywordLoc().isValid())
1904 return SourceRange(getElaboratedKeywordLoc(), getRAngleLoc());
1905 else if (getQualifierLoc())
1907 else if (getTemplateKeywordLoc().isValid())
1908 return SourceRange(getTemplateKeywordLoc(), getRAngleLoc());
1910 return SourceRange(getTemplateNameLoc(), getRAngleLoc());
1926 return llvm::alignOf<TemplateArgumentLocInfo>();
1942 PackExpansionType, PackExpansionTypeLocInfo> {
1953 return SourceRange(getEllipsisLoc(), getEllipsisLoc());
1957 setEllipsisLoc(Loc);
1974 AtomicType, AtomicTypeLocInfo> {
2006 return SourceRange(getLParenLoc(), getRParenLoc());
2010 setRParenLoc(Range.
getEnd());
TypeSourceInfo * getUnderlyingTInfo() const
unsigned getLocalDataSize() const
SourceLocation getEnd() const
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
static unsigned getFullDataSizeForType(QualType Ty)
Returns the size of type source info data block for the given type.
SourceLocation getElaboratedKeywordLoc() const
unsigned getLocalDataAlignment() const
Returns the alignment of the type source info data block that is specific to this type...
void initializeLocal(ASTContext &Context, SourceLocation Loc)
TypeSourceInfo * ClassTInfo
CXXRecordDecl * getDecl() const
QualType getInnerType() const
void setStarLoc(SourceLocation Loc)
SourceLocation TypeArgsRAngleLoc
Wrapper for source info for tag types. Note that this only records source info for the name itself; a...
SourceLocation getNameLoc() const
HasNoInnerType getInnerType() const
SourceLocation findNullabilityLoc() const
IdentifierInfo * getIdentifier() const
void setNameEndLoc(SourceLocation Loc)
unsigned getExtraLocalDataAlignment() const
void setRParenLoc(SourceLocation Loc)
void setStarLoc(SourceLocation Loc)
void setLAngleLoc(SourceLocation Loc)
TypeLoc getNamedTypeLoc() const
SourceLocation getLAngleLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setWrittenWidthSpec(TypeSpecifierWidth written)
ArrayRef< SourceLocation > getProtocolLocs() const
bool hasWrittenTypeSpec() const
TypeLoc getPatternLoc() const
QualType getInnerType() const
WrittenBuiltinSpecs & getWrittenBuiltinSpecs()
SourceRange getLocalSourceRange() const
SourceLocation ProtocolLAngleLoc
SourceLocation getLocalRangeBegin() const
void setTemplateKeywordLoc(SourceLocation Loc)
Wrapper for source info for typedefs.
bool hasBaseTypeAsWritten() const
A container of type source information.
unsigned EnumOperandLoc
A raw SourceLocation.
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
Wrapper for source info for pointers decayed from arrays and functions.
bool hasAttrEnumOperand() const
SourceLocation LocalRangeEnd
SourceRange getAttrOperandParensRange() const
TypeLoc getNextTypeLoc() const
unsigned getLocalDataSize() const
Returns the size of the type source info data block that is specific to this type.
Expr * getUnderlyingExpr() const
void setParensRange(SourceRange range)
Wrapper for source info for member pointers.
Wrapper of type source information for a type with non-trivial direct qualifiers. ...
bool hasAttrExprOperand() const
TypeSpecifierType
Specifies the kind of type.
unsigned getExtraLocalDataAlignment() const
bool hasAttrOperand() const
const Type * getTypePtr() const
ParmVarDecl - Represents a parameter to a function.
TypeLocClass getTypeLocClass() const
SourceLocation NameEndLoc
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getAmpAmpLoc() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
A reasonable base class for TypeLocs that correspond to types that are written as a type-specifier...
void setTypeArgTInfo(unsigned i, TypeSourceInfo *TInfo)
void setParensRange(SourceRange Range)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Base wrapper for a particular "section" of type source info.
QualType getInnerType() const
unsigned getExtraLocalDataSize() const
void setLocalRangeEnd(SourceLocation L)
SourceLocation TypeArgsLAngleLoc
bool isDefinition() const
True if the tag was defined in this type specifier.
unsigned getExtraLocalDataAlignment() const
SourceRange getLocalSourceRange() const
TypeLoc getPointeeLoc() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
unsigned getLocalDataAlignment() const
unsigned getExtraLocalDataSize() const
Returns the size of the type source info data block that is specific to this type.
A C++ nested-name-specifier augmented with source location information.
unsigned getNumArgs() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setBuiltinLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
TypeSpecifierSign
Specifies the signedness of a type, e.g., signed or unsigned.
EnumDecl * getDecl() const
void setRBracketLoc(SourceLocation Loc)
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
TypeSourceInfo * getTypeArgTInfo(unsigned i) const
SourceLocation getLocalRangeEnd() const
bool isCompleteDefinition() const
SourceLocation getTypeArgsRAngleLoc() const
bool hasWrittenSignSpec() const
SourceLocation RBracketLoc
SourceRange getLocalSourceRange() const
ParmVarDecl * getParam(unsigned i) const
UnresolvedUsingTypenameDecl * getDecl() const
void setElaboratedKeywordLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
Get the local source range.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
unsigned getNumProtocols() const
Wrapper for source info for unresolved typename using decls.
SourceLocation getBuiltinLoc() const
void copy(DependentTemplateSpecializationTypeLoc Loc)
SourceRange getLocalSourceRange() const
Wrapper of type source information for a type with no direct qualifiers.
RecordDecl * getDecl() const
SourceLocation getBeginLoc() const
Get the begin source location.
const Type * getTypePtr() const
void setLParenLoc(SourceLocation Loc)
void setNameLoc(SourceLocation Loc)
void setCaretLoc(SourceLocation Loc)
void setRAngleLoc(SourceLocation Loc)
Wrapper for source info for injected class names of class templates.
friend bool operator==(const TypeLoc &LHS, const TypeLoc &RHS)
bool HasBaseTypeAsWritten
SourceLocation getRAngleLoc() const
Wrapper for source info for functions.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
NestedNameSpecifierLoc getQualifierLoc() const
Wrapper for substituted template type parameters.
TypeSourceInfo * getClassTInfo() const
Wrapper for substituted template type parameters.
bool needsExtraLocalData() const
void setRParenLoc(SourceLocation Loc)
TypeLoc(const Type *ty, void *opaqueData)
unsigned getExtraLocalDataSize() const
SourceRange getLocalSourceRange() const
SourceLocation getRParenLoc() const
Wrapper for source info for ObjC interfaces.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceRange getLocalSourceRange() const
TypeClass getTypeClass() const
Represents an Objective-C protocol declaration.
void setProtocolLoc(unsigned i, SourceLocation Loc)
void setLocalRangeBegin(SourceLocation L)
Represents an ObjC class declaration.
void copy(ElaboratedTypeLoc Loc)
SourceLocation getTypeofLoc() const
SourceLocation getTypeArgsLAngleLoc() const
unsigned getNumParams() const
SourceLocation LocalRangeBegin
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type...
TypedefNameDecl * getTypedefNameDecl() const
SourceRange getBracketsRange() const
void setUnderlyingTInfo(TypeSourceInfo *TI) const
AttributedType::Kind getAttrKind() const
SourceRange getLocalSourceRange() const
TypeLoc getNextTypeLoc() const
Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the TypeLoc is a PointerLoc and next Typ...
void * QualifierData
Data associated with the nested-name-specifier location.
TagDecl * getDecl() const
QualType getInnerType() const
unsigned getExtraLocalDataAlignment() const
unsigned getExtraLocalDataSize() const
SourceLocation getAttrEnumOperandLoc() const
SourceLocation getNameLoc() const
SourceLocation getLBracketLoc() const
SourceRange getLocalSourceRange() const
SourceRange getLocalSourceRange() const
void setSizeExpr(Expr *Size)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
void initialize(ASTContext &Context, SourceLocation Loc) const
Initializes this to state that every location in this type is the given location. ...
QualType getPointeeType() const
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
void setTemplateNameLoc(SourceLocation Loc)
SourceLocation getElaboratedKeywordLoc() const
QualType getInnerType() const
Type source information for an attributed type.
SourceLocation getRBracketLoc() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
void setModeAttr(bool written)
void * getOpaqueData() const
Get the pointer where source information is stored.
SourceLocation EllipsisLoc
Declaration of a template type parameter.
TypeSpecifierWidth getWrittenWidthSpec() const
unsigned getExtraLocalDataSize() const
SourceLocation getSigilLoc() const
unsigned getExtraLocalDataAlignment() const
TypeLoc getInnerTypeLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getLParenLoc() const
void setWrittenSignSpec(TypeSpecifierSign written)
void setRParenLoc(SourceLocation Loc)
void setNameLoc(SourceLocation Loc)
void setLParenLoc(SourceLocation Loc)
SourceLocation getTemplateNameLoc() const
QualType getType() const
Get the type for which this source info wrapper provides information.
Wrapper for source info for enum types.
void setEllipsisLoc(SourceLocation Loc)
void setHasBaseTypeAsWritten(bool HasBaseType)
SourceRange getLocalSourceRange() const
SourceRange getParensRange() const
QualType getInnerType() const
SourceLocation getLocEnd() const LLVM_READONLY
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
TypeSourceInfo * UnderlyingTInfo
SourceLocation getRAngleLoc() const
const TypeClass * getTypePtr() const
SourceLocation getProtocolRAngleLoc() const
SourceLocation getEndLoc() const
Get the end source location.
void setStarLoc(SourceLocation Loc)
void setTypeofLoc(SourceLocation Loc)
void initializeFullCopy(TypeLoc Other) const
Initializes this by copying its information from another TypeLoc of the same type.
TypeLoc getInnerLoc() const
TemplateArgumentLoc getArgLoc(unsigned i) const
Wrapper for source info for arrays.
TypeLoc getNextTypeLoc() const
TemplateArgumentLoc getArgLoc(unsigned i) const
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
void setAttrOperandParensRange(SourceRange range)
SourceLocation getTemplateKeywordLoc() const
SourceLocation getRParenLoc() const
TypeLoc getValueLoc() const
void setLAngleLoc(SourceLocation Loc)
QualType getInnerType() const
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
const Type * getTypePtr() const
SourceRange OperandParens
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getLParenLoc() const
TagDecl - Represents the declaration of a struct/union/class/enum.
void setProtocolRAngleLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
SourceLocation getNameEndLoc() const
QualType getInnerType() const
SourceLocation getNameLoc() const
LocalData * getLocalData() const
friend bool operator!=(const TypeLoc &LHS, const TypeLoc &RHS)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation ProtocolRAngleLoc
unsigned getNumTypeArgs() const
SourceLocation getRParenLoc() const
UnqualTypeLoc(const Type *Ty, void *Data)
void setElaboratedKeywordLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
TypeLocClass getTypeLocClass() const
void setWrittenTypeSpec(TypeSpecifierType written)
SourceLocation getBegin() const
void setAmpLoc(SourceLocation Loc)
TypeLoc getReturnLoc() const
void setLBracketLoc(SourceLocation Loc)
SourceLocation ElaboratedKWLoc
QualType getInnerType() const
SourceRange getLocalSourceRange() const
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
SourceLocation getKWLoc() const
static QualType getFromOpaquePtr(const void *Ptr)
void * getExtraLocalData() const
SourceLocation getNameLoc() const
Defines various enumerations that describe declaration and type specifiers.
void setLParenLoc(SourceLocation Loc)
QualType getInnerType() const
void setTemplateKeywordLoc(SourceLocation Loc)
TypeLoc(QualType ty, void *opaqueData)
void setTypeArgsLAngleLoc(SourceLocation Loc)
Base class for declarations which introduce a typedef-name.
Represents a template argument.
void setClassTInfo(TypeSourceInfo *TI)
void initializeLocal(ASTContext &Context, SourceLocation loc)
SourceLocation TemplateKWLoc
SourceRange getLocalSourceRange() const
void setAmpAmpLoc(SourceLocation Loc)
unsigned getLocalDataSize() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getEllipsisLoc() const
SourceLocation getLocStart() const LLVM_READONLY
TypeLoc IgnoreParens() const
SourceLocation getStarLoc() const
SourceLocation getTemplateKeywordLoc() const
Represents a dependent using declaration which was marked with typename.
SourceLocation getCaretLoc() const
Expr * getSizeExpr() const
ObjCInterfaceDecl * getIFaceDecl() const
void * getNonLocalData() const
SourceRange getLocalSourceRange() const
SourceLocation getElaboratedKeywordLoc() const
QualType getUnderlyingType() const
void setSigilLoc(SourceLocation Loc)
TemplateTypeParmDecl * getDecl() const
void * getOpaqueData() const
Retrieve the opaque pointer that refers to source-location data.
void setNameLoc(SourceLocation Loc)
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
void setAttrEnumOperandLoc(SourceLocation loc)
TypeSpecifierSign getWrittenSignSpec() const
static bool classof(const OMPClause *T)
TypeLoc getOriginalLoc() const
unsigned getExtraLocalDataAlignment() const
QualType getInnerType() const
unsigned getNumArgs() const
UnqualTypeLoc getUnqualifiedLoc() const
SourceRange getParensRange() const
TypeLoc getBaseLoc() const
void setTypeArgsRAngleLoc(SourceLocation Loc)
Wrapper for source info for record types.
void copy(TemplateSpecializationTypeLoc Loc)
Copy the location information from the given info.
ObjCProtocolDecl * getProtocol(unsigned i) const
Wraps an ObjCPointerType with source location information.
const TypeClass * getTypePtr() const
SourceLocation BuiltinLoc
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation getProtocolLAngleLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
Structure that packs information about the type specifiers that were written in a particular type spe...
Expr * getUnderlyingExpr() const
unsigned getFullDataSize() const
Returns the size of the type source info data block.
void setKWLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
SourceLocation getProtocolLoc(unsigned i) const
bool hasWrittenWidthSpec() const
SourceRange getParensRange() const
void setEnd(SourceLocation e)
Represents a C++ struct/union/class.
TypeSpecifierWidth
Specifies the width of a type, e.g., short, long, or long long.
SourceLocation getTemplateNameLoc() const
void setParam(unsigned i, ParmVarDecl *VD)
void copyLocal(TypeLoc other)
static unsigned getLocalAlignmentForType(QualType Ty)
Returns the alignment of type source info data block for the given type.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
void copyLocal(Derived other)
SourceRange getLocalSourceRange() const
TypeLoc getElementLoc() const
void setLParenLoc(SourceLocation Loc)
SourceLocation getRParenLoc() const
Location information for a TemplateArgument.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceRange getLocalSourceRange() const
ArrayRef< ParmVarDecl * > getParams() const
void setRAngleLoc(SourceLocation Loc)
SourceLocation TemplateKWLoc
const WrittenBuiltinSpecs & getWrittenBuiltinSpecs() const
void copy(TypeLoc other)
Copies the other type loc into this one.
void setProtocolLAngleLoc(SourceLocation Loc)
SourceLocation getStarLoc() const
SourceLocation getAmpLoc() const
SourceLocation getLAngleLoc() const
Wrapper for source info for builtin types.
void setRParenLoc(SourceLocation Loc)
Wrapper for template type parameters.
A trivial tuple used to represent a source range.
SourceLocation getLocation() const
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
void copy(DependentNameTypeLoc Loc)
NestedNameSpecifierLoc getQualifierLoc() const
void setTemplateNameLoc(SourceLocation Loc)
ParmVarDecl ** getParmArray() const
const Type * getClass() const
unsigned getExtraLocalDataSize() const
Wrapper for source info for pointers.
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
Wrapper for source info for block pointers.
void initializeFullCopy(TypeLoc Other, unsigned Size) const
Initializes this by copying its information from another TypeLoc of the same type. The given size must be the full data size.
void setElaboratedKeywordLoc(SourceLocation Loc)
SourceLocation getStarLoc() const
SourceLocation getLParenLoc() const
SourceLocation getLParenLoc() const