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);
168 initializeImpl(Context, *
this, Loc);
195 return !(LHS == RHS);
203 static bool isKind(
const TypeLoc&) {
211 static SourceRange getLocalSourceRangeImpl(
TypeLoc TL);
217 return TypeLoc(Ty, const_cast<void*>(static_cast<const void*>(
this + 1)));
228 return reinterpret_cast<const Type*
>(
Ty);
237 static bool isKind(
const TypeLoc &TL) {
257 dataInt = llvm::alignTo(dataInt, align);
292 static bool isKind(
const TypeLoc &TL) {
300 return castAs<UnqualTypeLoc>();
331 template <
class Base,
class Derived,
class TypeClass,
class LocalData>
334 const Derived *asDerived()
const {
335 return static_cast<const Derived*
>(
this);
339 static bool isKind(
const TypeLoc &TL) {
344 static bool classofType(
const Type *Ty) {
350 return std::max(llvm::alignOf<LocalData>(),
354 unsigned size =
sizeof(LocalData);
355 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
356 size = llvm::alignTo(size, extraAlign);
357 size += asDerived()->getExtraLocalDataSize();
366 memcpy(
getLocalData(), other.getLocalData(),
sizeof(LocalData));
372 asDerived()->getExtraLocalDataSize());
380 return cast<TypeClass>(Base::getTypePtr());
393 return static_cast<LocalData*
>(Base::Data);
400 unsigned size =
sizeof(LocalData);
401 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
402 size = llvm::alignTo(size, extraAlign);
403 return reinterpret_cast<char*
>(Base::Data) + size;
408 data += asDerived()->getLocalDataSize();
409 data = llvm::alignTo(data, getNextTypeAlign());
410 return reinterpret_cast<void*
>(data);
421 unsigned getInnerTypeSize()
const {
425 unsigned getInnerTypeSize(HasNoInnerType _)
const {
429 unsigned getInnerTypeSize(QualType _)
const {
433 unsigned getNextTypeAlign()
const {
437 unsigned getNextTypeAlign(HasNoInnerType _)
const {
441 unsigned getNextTypeAlign(QualType T)
const {
457 template <
class Base,
class Derived,
class TypeClass>
460 static bool classofType(
const Type *Ty) {
464 static bool isKind(
const TypeLoc &TL) {
468 static bool isKind(
const UnqualTypeLoc &TL) {
469 return Derived::classofType(TL.getTypePtr());
474 return cast<TypeClass>(Base::getTypePtr());
508 static bool isKind(
const TypeLoc &TL);
540 return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128)
541 || (bk >= BuiltinType::Short && bk <= BuiltinType::Float128)
542 || bk == BuiltinType::UChar
543 || bk == BuiltinType::SChar;
551 return needsExtraLocalData() ? llvm::alignOf<WrittenBuiltinSpecs>() : 1;
555 return SourceRange(getBuiltinLoc(), getBuiltinLoc());
559 if (needsExtraLocalData())
568 if (needsExtraLocalData())
569 getWrittenBuiltinSpecs().Sign = written;
573 if (needsExtraLocalData())
582 if (needsExtraLocalData())
583 getWrittenBuiltinSpecs().Width = written;
591 if (needsExtraLocalData())
592 getWrittenBuiltinSpecs().Type = written;
596 if (needsExtraLocalData())
597 return getWrittenBuiltinSpecs().ModeAttr;
602 if (needsExtraLocalData())
603 getWrittenBuiltinSpecs().ModeAttr = written;
608 if (needsExtraLocalData()) {
633 InjectedClassNameTypeLoc,
634 InjectedClassNameType> {
644 UnresolvedUsingTypeLoc,
645 UnresolvedUsingType> {
690 TemplateTypeParmTypeLoc,
691 TemplateTypeParmType> {
699 SubstTemplateTypeParmTypeLoc,
700 SubstTemplateTypeParmType> {
706 SubstTemplateTypeParmPackTypeLoc,
707 SubstTemplateTypeParmPackType> {
744 return hasAttrExprOperand() || hasAttrEnumOperand();
755 TypeLoc getModifiedLoc()
const {
762 SourceLocation getAttrNameLoc()
const {
765 void setAttrNameLoc(SourceLocation loc) {
772 Expr *getAttrExprOperand()
const {
773 assert(hasAttrExprOperand());
776 void setAttrExprOperand(Expr *e) {
777 assert(hasAttrExprOperand());
785 assert(hasAttrEnumOperand());
789 assert(hasAttrEnumOperand());
798 assert(hasAttrOperand());
802 assert(hasAttrOperand());
817 if (hasAttrOperand())
818 range.
setEnd(getAttrOperandParensRange().getEnd());
824 if (hasAttrExprOperand()) {
826 setAttrExprOperand(
nullptr);
827 }
else if (hasAttrEnumOperand()) {
829 setAttrEnumOperandLoc(loc);
855 ObjCObjectTypeLocInfo> {
864 return (
SourceLocation*)(getTypeArgLocArray() + getNumTypeArgs());
883 return this->
getTypePtr()->getTypeArgsAsWritten().size();
887 assert(i < getNumTypeArgs() &&
"Index is out of bounds!");
888 return getTypeArgLocArray()[i];
892 assert(i < getNumTypeArgs() &&
"Index is out of bounds!");
893 getTypeArgLocArray()[i] = TInfo;
915 assert(i < getNumProtocols() &&
"Index is out of bounds!");
916 return getProtocolLocArray()[i];
919 assert(i < getNumProtocols() &&
"Index is out of bounds!");
920 getProtocolLocArray()[i] = Loc;
924 assert(i < getNumProtocols() &&
"Index is out of bounds!");
925 return *(this->
getTypePtr()->qual_begin() + i);
930 return llvm::makeArrayRef(getProtocolLocArray(), getNumProtocols());
948 start = getProtocolLAngleLoc();
951 end = getTypeArgsRAngleLoc();
963 assert(llvm::alignOf<ObjCObjectTypeLoc>()
964 >= llvm::alignOf<TypeSourceInfo *>() &&
965 "not enough alignment for tail-allocated data");
966 return llvm::alignOf<TypeSourceInfo *>();
982 ObjCInterfaceTypeLoc,
984 ObjCInterfaceLocInfo> {
1039 return SourceRange(getLParenLoc(), getRParenLoc());
1057 if (ParenTypeLoc::isKind(*
this))
1058 return IgnoreParensImpl(*
this);
1066 AdjustedType, AdjustedLocInfo> {
1096 AdjustedTypeLoc, DecayedTypeLoc, DecayedType> {
1104 template <
class Derived,
class TypeClass,
class LocalData = Po
interLikeLocInfo>
1106 TypeClass, LocalData> {
1138 return getSigilLoc();
1151 return getSigilLoc();
1165 MemberPointerLocInfo> {
1168 return getSigilLoc();
1186 setClassTInfo(
nullptr);
1191 return SourceRange(TI->getTypeLoc().getBeginLoc(), getStarLoc());
1200 ObjCObjectPointerType> {
1203 return getSigilLoc();
1216 return getTypePtr()->getPointeeTypeAsWritten();
1222 LValueReferenceTypeLoc,
1223 LValueReferenceType> {
1226 return getSigilLoc();
1235 RValueReferenceTypeLoc,
1236 RValueReferenceType> {
1239 return getSigilLoc();
1289 return SourceRange(getLParenLoc(), getRParenLoc());
1293 return llvm::makeArrayRef(getParmArray(), getNumParams());
1304 return cast<FunctionProtoType>(
getTypePtr())->getNumParams();
1314 return SourceRange(getLocalRangeBegin(), getLocalRangeEnd());
1318 setLocalRangeBegin(Loc);
1321 setLocalRangeEnd(Loc);
1322 for (
unsigned i = 0, e = getNumParams(); i != e; ++i)
1323 setParam(i,
nullptr);
1333 return llvm::alignOf<ParmVarDecl*>();
1341 FunctionProtoTypeLoc,
1342 FunctionProtoType> {
1347 FunctionNoProtoTypeLoc,
1348 FunctionNoProtoType> {
1378 return SourceRange(getLBracketLoc(), getRBracketLoc());
1393 return SourceRange(getLBracketLoc(), getRBracketLoc());
1397 setLBracketLoc(Loc);
1398 setRBracketLoc(Loc);
1399 setSizeExpr(
nullptr);
1407 ConstantArrayTypeLoc,
1408 ConstantArrayType> {
1413 IncompleteArrayTypeLoc,
1414 IncompleteArrayType> {
1419 DependentSizedArrayTypeLoc,
1420 DependentSizedArrayType> {
1426 VariableArrayTypeLoc,
1427 VariableArrayType> {
1444 TemplateSpecializationTypeLoc,
1445 TemplateSpecializationType,
1446 TemplateSpecializationLocInfo> {
1473 getArgInfos()[i] = AI;
1476 return getArgInfos()[i];
1503 if (getTemplateKeywordLoc().isValid())
1504 return SourceRange(getTemplateKeywordLoc(), getRAngleLoc());
1506 return SourceRange(getTemplateNameLoc(), getRAngleLoc());
1510 setTemplateKeywordLoc(Loc);
1511 setTemplateNameLoc(Loc);
1515 getArgInfos(), Loc);
1528 return llvm::alignOf<TemplateArgumentLocInfo>();
1560 DependentSizedExtVectorTypeLoc,
1561 DependentSizedExtVectorType> {
1583 template <
class Derived,
class TypeClass,
class LocalData = TypeofLocInfo>
1585 :
public ConcreteTypeLoc<UnqualTypeLoc, Derived, TypeClass, LocalData> {
1609 return SourceRange(getLParenLoc(), getRParenLoc());
1613 setRParenLoc(range.
getEnd());
1617 return SourceRange(getTypeofLoc(), getRParenLoc());
1629 TypeOfExprTypeLocInfo> {
1644 return this->
getTypePtr()->getUnderlyingType();
1672 UnaryTransformTypeLoc,
1674 UnaryTransformTypeLocInfo> {
1697 return SourceRange(getLParenLoc(), getRParenLoc());
1701 setRParenLoc(Range.
getEnd());
1725 ElaboratedLocInfo> {
1742 "Inconsistent nested-name-specifier pointer");
1747 if (getElaboratedKeywordLoc().isValid())
1748 if (getQualifierLoc())
1754 return getQualifierLoc().getSourceRange();
1781 DependentNameTypeLoc,
1783 DependentNameLocInfo> {
1800 "Inconsistent nested-name-specifier pointer");
1812 if (getElaboratedKeywordLoc().isValid())
1836 DependentTemplateSpecializationTypeLoc,
1837 DependentTemplateSpecializationType,
1838 DependentTemplateSpecializationLocInfo> {
1856 if (!QualifierLoc) {
1867 "Inconsistent nested-name-specifier pointer");
1904 getArgInfos()[i] = AI;
1907 return getArgInfos()[i];
1915 if (getElaboratedKeywordLoc().isValid())
1916 return SourceRange(getElaboratedKeywordLoc(), getRAngleLoc());
1917 else if (getQualifierLoc())
1919 else if (getTemplateKeywordLoc().isValid())
1920 return SourceRange(getTemplateKeywordLoc(), getRAngleLoc());
1922 return SourceRange(getTemplateNameLoc(), getRAngleLoc());
1938 return llvm::alignOf<TemplateArgumentLocInfo>();
1954 PackExpansionType, PackExpansionTypeLocInfo> {
1965 return SourceRange(getEllipsisLoc(), getEllipsisLoc());
1969 setEllipsisLoc(Loc);
1986 AtomicType, AtomicTypeLocInfo> {
2018 return SourceRange(getLParenLoc(), getRParenLoc());
2022 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
A (possibly-)qualified type.
QualType getInnerType() const
void setStarLoc(SourceLocation Loc)
SourceLocation TypeArgsRAngleLoc
Wrapper for source info for tag types.
SourceLocation getNameLoc() const
HasNoInnerType getInnerType() const
SourceLocation findNullabilityLoc() const
Find the location of the nullability specifier (__nonnull, __nullable, or __null_unspecifier), if there is one.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
void setNameEndLoc(SourceLocation Loc)
void setKWLoc(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)
C Language Family Type Representation.
void setWrittenWidthSpec(TypeSpecifierWidth written)
ArrayRef< SourceLocation > getProtocolLocs() const
bool hasWrittenTypeSpec() const
TypeLoc getPatternLoc() const
QualType getInnerType() const
WrittenBuiltinSpecs & getWrittenBuiltinSpecs()
SourceRange getLocalSourceRange() const
SourceLocation ProtocolLAngleLoc
The base class of the type hierarchy.
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
The location of the parentheses around the operand, if there is an operand.
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.
RecordDecl - Represents a struct/union/class.
QualType getInnerType() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
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
isCompleteDefinition - Return true if this decl has its body fully specified.
SourceLocation getTypeArgsRAngleLoc() const
bool hasWrittenSignSpec() const
SourceLocation RBracketLoc
const TemplateArgument * getArgs() const
Retrieve the template arguments.
SourceRange getLocalSourceRange() const
ParmVarDecl * getParam(unsigned i) const
UnresolvedUsingTypenameDecl * getDecl() const
void setElaboratedKeywordLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
Get the local source range.
TypeLoc getValueLoc() const
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.
QualType getInnerType() const
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)
Initializes the local data of this type source info block to provide no information.
const TemplateArgument & getArg(unsigned Idx) const
Retrieve a specific template argument as a type.
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
SourceLocation getKWLoc() 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
The modified type, which is generally canonically different from the attribute type.
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
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
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)
Expr - This represents one expression.
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
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
QualType getInnerType() const
SourceLocation getLocEnd() const LLVM_READONLY
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
TypeSourceInfo * UnderlyingTInfo
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
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)
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.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
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
A metaprogramming base class for TypeLoc classes which correspond to a particular Type subclass...
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)
TypeLocClass
The kinds of TypeLocs.
void setElaboratedKeywordLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
TypeLocClass getTypeLocClass() const
void setWrittenTypeSpec(TypeSpecifierType written)
SourceRange getLocalSourceRange() const
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
A metaprogramming class designed for concrete subtypes of abstract types where all subtypes share equ...
SourceLocation getKWLoc() const
static QualType getFromOpaquePtr(const void *Ptr)
void * getExtraLocalData() const
Gets a pointer past the Info structure; useful for classes with local data that can't be captured in ...
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)
TypeLoc findExplicitQualifierLoc() const
Find a type with the location of an explicit type qualifier.
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
EnumDecl - Represents an enum.
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
Location wrapper for a TemplateArgument.
static bool classof(const OMPClause *T)
TypeLoc getOriginalLoc() const
unsigned getExtraLocalDataAlignment() const
QualType getInnerType() const
unsigned getNumArgs() const
UnqualTypeLoc getUnqualifiedLoc() const
NestedNameSpecifier * getQualifier() 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
char __ovld __cnfn max(char x, char y)
Returns y if x < y, otherwise it returns x.
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
void initializeFullCopy(TypeLoc Other)
Initializes this by copying its information from another TypeLoc of the same type.
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.
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
void initializeFullCopy(TypeLoc Other, unsigned Size)
Initializes this by copying its information from another TypeLoc of the same type.
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 setElaboratedKeywordLoc(SourceLocation Loc)
unsigned getNumArgs() const
Retrieve the number of template arguments.
SourceLocation getStarLoc() const
SourceLocation getLParenLoc() const
SourceLocation getLParenLoc() const