15 #ifndef LLVM_CLANG_AST_TYPELOC_H 16 #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" 39 class ObjCInterfaceDecl;
40 class ObjCProtocolDecl;
41 class ObjCTypeParamDecl;
42 class TemplateTypeParmDecl;
44 class UnresolvedUsingTypenameDecl;
47 #define ABSTRACT_TYPELOC(Class, Base) 48 #define TYPELOC(Class, Base) \ 50 #include "clang/AST/TypeLocNodes.def" 60 const void *
Ty =
nullptr;
66 : Ty(ty.getAsOpaquePtr()), Data(opaqueData) {}
68 : Ty(ty), Data(opaqueData) {}
76 assert(T::isKind(*
this));
87 if (!T::isKind(*
this))
106 #define ABSTRACT_TYPE(Class, Base) 107 #define TYPE(Class, Base) \ 109 #include "clang/AST/TypeNodes.def" 119 explicit operator bool()
const {
return Ty; }
159 return getLocalSourceRangeImpl(*
this);
170 return getNextTypeLocImpl(*
this);
192 initializeImpl(Context, *
this, Loc);
219 return !(LHS == RHS);
227 static bool isKind(
const TypeLoc&) {
241 return TypeLoc(
Ty, const_cast<void*>(static_cast<const void*>(
this + 1)));
252 return reinterpret_cast<const Type*
>(
Ty);
262 static bool isKind(
const TypeLoc &TL) {
280 dataInt = llvm::alignTo(dataInt, align);
316 static bool isKind(
const TypeLoc &TL) {
324 return castAs<UnqualTypeLoc>();
355 template <
class Base,
class Derived,
class TypeClass,
class LocalData>
359 const Derived *asDerived()
const {
360 return static_cast<const Derived*
>(
this);
363 static bool isKind(
const TypeLoc &TL) {
368 static bool classofType(
const Type *
Ty) {
374 return std::max(
unsigned(
alignof(LocalData)),
375 asDerived()->getExtraLocalDataAlignment());
379 unsigned size =
sizeof(LocalData);
380 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
381 size = llvm::alignTo(size, extraAlign);
382 size += asDerived()->getExtraLocalDataSize();
388 if (asDerived()->getLocalDataSize() == 0)
return;
391 memcpy(getLocalData(), other.getLocalData(),
sizeof(LocalData));
396 memcpy(getExtraLocalData(), other.getExtraLocalData(),
397 asDerived()->getExtraLocalDataSize());
405 return cast<TypeClass>(Base::getTypePtr());
418 return static_cast<LocalData*
>(Base::Data);
425 unsigned size =
sizeof(LocalData);
426 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
427 size = llvm::alignTo(size, extraAlign);
428 return reinterpret_cast<char*
>(Base::Data) + size;
433 data += asDerived()->getLocalDataSize();
434 data = llvm::alignTo(data, getNextTypeAlign());
435 return reinterpret_cast<void*
>(data);
442 return TypeLoc(asDerived()->getInnerType(), getNonLocalData());
446 unsigned getInnerTypeSize()
const {
447 return getInnerTypeSize(asDerived()->getInnerType());
450 unsigned getInnerTypeSize(HasNoInnerType _)
const {
454 unsigned getInnerTypeSize(
QualType _)
const {
455 return getInnerTypeLoc().getFullDataSize();
458 unsigned getNextTypeAlign()
const {
459 return getNextTypeAlign(asDerived()->getInnerType());
462 unsigned getNextTypeAlign(HasNoInnerType _)
const {
466 unsigned getNextTypeAlign(
QualType T)
const {
473 return TypeLoc(T, getNonLocalData());
480 template <
class Base,
class Derived,
class TypeClass>
484 static bool classofType(
const Type *
Ty) {
488 static bool isKind(
const TypeLoc &TL) {
498 return cast<TypeClass>(Base::getTypePtr());
519 return this->getLocalData()->NameLoc;
523 this->getLocalData()->NameLoc = Loc;
537 static bool isKind(
const TypeLoc &TL);
551 return getLocalData()->BuiltinRange.getBegin();
555 getLocalData()->BuiltinRange = Loc;
559 SourceRange &BuiltinRange = getLocalData()->BuiltinRange;
561 BuiltinRange = Range;
579 return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128)
580 || (bk >= BuiltinType::Short && bk <= BuiltinType::Float128)
581 || bk == BuiltinType::UChar
582 || bk == BuiltinType::SChar;
594 return getLocalData()->BuiltinRange;
598 if (needsExtraLocalData())
609 if (needsExtraLocalData())
610 getWrittenBuiltinSpecs().Sign = written;
614 if (needsExtraLocalData())
625 if (needsExtraLocalData())
626 getWrittenBuiltinSpecs().Width = written;
636 if (needsExtraLocalData())
637 getWrittenBuiltinSpecs().Type = written;
641 if (needsExtraLocalData())
642 return getWrittenBuiltinSpecs().ModeAttr;
648 if (needsExtraLocalData())
649 getWrittenBuiltinSpecs().ModeAttr = written;
654 if (needsExtraLocalData()) {
678 InjectedClassNameTypeLoc,
679 InjectedClassNameType> {
689 UnresolvedUsingTypeLoc,
690 UnresolvedUsingType> {
735 TemplateTypeParmTypeLoc,
736 TemplateTypeParmType> {
748 ObjCTypeParamTypeLoc,
750 ObjCTypeParamTypeLocInfo> {
760 return this->getLocalData()->NameLoc;
764 this->getLocalData()->NameLoc = Loc;
768 return getNumProtocols() ?
778 return getNumProtocols() ?
792 assert(i < getNumProtocols() &&
"Index is out of bounds!");
793 return getProtocolLocArray()[i];
797 assert(i < getNumProtocols() &&
"Index is out of bounds!");
798 getProtocolLocArray()[i] = Loc;
802 assert(i < getNumProtocols() &&
"Index is out of bounds!");
803 return *(this->
getTypePtr()->qual_begin() + i);
807 return llvm::makeArrayRef(getProtocolLocArray(), getNumProtocols());
813 if (!this->getNumProtocols())
return 0;
834 SubstTemplateTypeParmTypeLoc,
835 SubstTemplateTypeParmType> {
841 SubstTemplateTypeParmPackTypeLoc,
842 SubstTemplateTypeParmPackType> {
879 return hasAttrExprOperand() || hasAttrEnumOperand();
891 return getInnerTypeLoc();
898 return getLocalData()->AttrLoc;
901 getLocalData()->AttrLoc = loc;
908 assert(hasAttrExprOperand());
909 return getLocalData()->ExprOperand;
912 assert(hasAttrExprOperand());
913 getLocalData()->ExprOperand = e;
920 assert(hasAttrEnumOperand());
924 assert(hasAttrEnumOperand());
933 assert(hasAttrOperand());
934 return getLocalData()->OperandParens;
937 assert(hasAttrOperand());
938 getLocalData()->OperandParens = range;
952 if (hasAttrOperand())
953 range.
setEnd(getAttrOperandParensRange().getEnd());
959 if (hasAttrExprOperand()) {
961 setAttrExprOperand(
nullptr);
962 }
else if (hasAttrEnumOperand()) {
964 setAttrEnumOperandLoc(loc);
989 ObjCObjectTypeLocInfo> {
998 return (
SourceLocation*)(getTypeArgLocArray() + getNumTypeArgs());
1003 return this->getLocalData()->TypeArgsLAngleLoc;
1007 this->getLocalData()->TypeArgsLAngleLoc = Loc;
1011 return this->getLocalData()->TypeArgsRAngleLoc;
1015 this->getLocalData()->TypeArgsRAngleLoc = Loc;
1019 return this->
getTypePtr()->getTypeArgsAsWritten().size();
1023 assert(i < getNumTypeArgs() &&
"Index is out of bounds!");
1024 return getTypeArgLocArray()[i];
1028 assert(i < getNumTypeArgs() &&
"Index is out of bounds!");
1029 getTypeArgLocArray()[i] = TInfo;
1033 return this->getLocalData()->ProtocolLAngleLoc;
1037 this->getLocalData()->ProtocolLAngleLoc = Loc;
1041 return this->getLocalData()->ProtocolRAngleLoc;
1045 this->getLocalData()->ProtocolRAngleLoc = Loc;
1049 return this->
getTypePtr()->getNumProtocols();
1053 assert(i < getNumProtocols() &&
"Index is out of bounds!");
1054 return getProtocolLocArray()[i];
1058 assert(i < getNumProtocols() &&
"Index is out of bounds!");
1059 getProtocolLocArray()[i] = Loc;
1063 assert(i < getNumProtocols() &&
"Index is out of bounds!");
1064 return *(this->
getTypePtr()->qual_begin() + i);
1069 return llvm::makeArrayRef(getProtocolLocArray(), getNumProtocols());
1073 return getLocalData()->HasBaseTypeAsWritten;
1077 getLocalData()->HasBaseTypeAsWritten = HasBaseType;
1081 return getInnerTypeLoc();
1087 start = getProtocolLAngleLoc();
1090 end = getTypeArgsRAngleLoc();
1103 "not enough alignment for tail-allocated data");
1119 ObjCInterfaceTypeLoc,
1121 ObjCInterfaceLocInfo> {
1128 return getLocalData()->NameLoc;
1132 getLocalData()->NameLoc = Loc;
1136 return SourceRange(getNameLoc(), getNameEndLoc());
1140 return getLocalData()->NameEndLoc;
1144 getLocalData()->NameEndLoc = Loc;
1163 return this->getLocalData()->LParenLoc;
1167 return this->getLocalData()->RParenLoc;
1171 this->getLocalData()->LParenLoc = Loc;
1175 this->getLocalData()->RParenLoc = Loc;
1179 return SourceRange(getLParenLoc(), getRParenLoc());
1188 return getInnerTypeLoc();
1197 if (ParenTypeLoc::isKind(*
this))
1198 return IgnoreParensImpl(*
this);
1205 AdjustedType, AdjustedLocInfo> {
1208 return getInnerTypeLoc();
1233 AdjustedTypeLoc, DecayedTypeLoc, DecayedType> {
1241 template <
class Derived,
class TypeClass,
class LocalData = Po
interLikeLocInfo>
1243 TypeClass, LocalData> {
1246 return this->getLocalData()->StarLoc;
1250 this->getLocalData()->StarLoc = Loc;
1254 return this->getInnerTypeLoc();
1275 return getSigilLoc();
1288 return getSigilLoc();
1303 MemberPointerLocInfo> {
1306 return getSigilLoc();
1318 return getLocalData()->ClassTInfo;
1322 getLocalData()->ClassTInfo = TI;
1327 setClassTInfo(
nullptr);
1332 return SourceRange(TI->getTypeLoc().getBeginLoc(), getStarLoc());
1341 ObjCObjectPointerType> {
1344 return getSigilLoc();
1356 return getTypePtr()->getPointeeTypeAsWritten();
1362 LValueReferenceTypeLoc,
1363 LValueReferenceType> {
1366 return getSigilLoc();
1376 RValueReferenceTypeLoc,
1377 RValueReferenceType> {
1380 return getSigilLoc();
1400 bool hasExceptionSpec()
const {
1401 if (
auto *FPT = dyn_cast<FunctionProtoType>(
getTypePtr())) {
1402 return FPT->hasExceptionSpec();
1408 assert(hasExceptionSpec() &&
"No exception spec range");
1411 return (
SourceRange *)(getParmArray() + getNumParams());
1416 return getLocalData()->LocalRangeBegin;
1420 getLocalData()->LocalRangeBegin = L;
1424 return getLocalData()->LocalRangeEnd;
1428 getLocalData()->LocalRangeEnd = L;
1432 return this->getLocalData()->LParenLoc;
1436 this->getLocalData()->LParenLoc = Loc;
1440 return this->getLocalData()->RParenLoc;
1444 this->getLocalData()->RParenLoc = Loc;
1448 return SourceRange(getLParenLoc(), getRParenLoc());
1452 if (hasExceptionSpec())
1453 return *getExceptionSpecRangePtr();
1458 if (hasExceptionSpec())
1459 *getExceptionSpecRangePtr() = R;
1463 return llvm::makeArrayRef(getParmArray(), getNumParams());
1474 return cast<FunctionProtoType>(
getTypePtr())->getNumParams();
1481 return getInnerTypeLoc();
1485 return SourceRange(getLocalRangeBegin(), getLocalRangeEnd());
1489 setLocalRangeBegin(Loc);
1492 setLocalRangeEnd(Loc);
1493 for (
unsigned i = 0, e = getNumParams(); i != e; ++i)
1494 setParam(i,
nullptr);
1495 if (hasExceptionSpec())
1496 setExceptionSpecRange(Loc);
1502 unsigned ExceptSpecSize = hasExceptionSpec() ?
sizeof(
SourceRange) : 0;
1503 return (getNumParams() *
sizeof(
ParmVarDecl *)) + ExceptSpecSize;
1513 FunctionProtoTypeLoc,
1514 FunctionProtoType> {
1519 FunctionNoProtoTypeLoc,
1520 FunctionNoProtoType> {
1535 return getLocalData()->LBracketLoc;
1539 getLocalData()->LBracketLoc = Loc;
1543 return getLocalData()->RBracketLoc;
1547 getLocalData()->RBracketLoc = Loc;
1551 return SourceRange(getLBracketLoc(), getRBracketLoc());
1555 return getLocalData()->Size;
1559 getLocalData()->Size = Size;
1563 return getInnerTypeLoc();
1567 return SourceRange(getLBracketLoc(), getRBracketLoc());
1571 setLBracketLoc(Loc);
1572 setRBracketLoc(Loc);
1573 setSizeExpr(
nullptr);
1581 ConstantArrayTypeLoc,
1582 ConstantArrayType> {
1587 IncompleteArrayTypeLoc,
1588 IncompleteArrayType> {
1593 DependentSizedArrayTypeLoc,
1594 DependentSizedArrayType> {
1604 VariableArrayTypeLoc,
1605 VariableArrayType> {
1621 TemplateSpecializationTypeLoc,
1622 TemplateSpecializationType,
1623 TemplateSpecializationLocInfo> {
1626 return getLocalData()->TemplateKWLoc;
1630 getLocalData()->TemplateKWLoc = Loc;
1634 return getLocalData()->LAngleLoc;
1638 getLocalData()->LAngleLoc = Loc;
1642 return getLocalData()->RAngleLoc;
1646 getLocalData()->RAngleLoc = Loc;
1654 getArgInfos()[i] = AI;
1658 return getArgInfos()[i];
1666 return getLocalData()->NameLoc;
1670 getLocalData()->NameLoc = Loc;
1686 if (getTemplateKeywordLoc().isValid())
1687 return SourceRange(getTemplateKeywordLoc(), getRAngleLoc());
1689 return SourceRange(getTemplateNameLoc(), getRAngleLoc());
1693 setTemplateKeywordLoc(Loc);
1694 setTemplateNameLoc(Loc);
1697 initializeArgLocs(Context, getNumArgs(),
getTypePtr()->getArgs(),
1698 getArgInfos(), Loc);
1701 static void initializeArgLocs(
ASTContext &Context,
unsigned NumArgs,
1728 DependentAddressSpaceTypeLoc,
1729 DependentAddressSpaceType,
1730 DependentAddressSpaceLocInfo> {
1736 return getLocalData()->AttrLoc;
1739 getLocalData()->AttrLoc = loc;
1746 return getLocalData()->ExprOperand;
1749 getLocalData()->ExprOperand = e;
1757 return getLocalData()->OperandParens;
1760 getLocalData()->OperandParens = range;
1765 range.
setEnd(getAttrOperandParensRange().getEnd());
1778 return this->getInnerTypeLoc();
1782 setAttrNameLoc(loc);
1784 setAttrExprOperand(
getTypePtr()->getAddrSpaceExpr());
1811 DependentSizedExtVectorTypeLoc,
1812 DependentSizedExtVectorType> {
1834 template <
class Derived,
class TypeClass,
class LocalData = TypeofLocInfo>
1836 :
public ConcreteTypeLoc<UnqualTypeLoc, Derived, TypeClass, LocalData> {
1839 return this->getLocalData()->TypeofLoc;
1843 this->getLocalData()->TypeofLoc = Loc;
1847 return this->getLocalData()->LParenLoc;
1851 this->getLocalData()->LParenLoc = Loc;
1855 return this->getLocalData()->RParenLoc;
1859 this->getLocalData()->RParenLoc = Loc;
1863 return SourceRange(getLParenLoc(), getRParenLoc());
1868 setRParenLoc(range.
getEnd());
1872 return SourceRange(getTypeofLoc(), getRParenLoc());
1884 TypeOfExprTypeLocInfo> {
1900 return this->
getTypePtr()->getUnderlyingType();
1904 return this->getLocalData()->UnderlyingTInfo;
1908 this->getLocalData()->UnderlyingTInfo = TI;
1930 UnaryTransformTypeLoc,
1932 UnaryTransformTypeLocInfo> {
1944 return getLocalData()->UnderlyingTInfo;
1948 getLocalData()->UnderlyingTInfo = TInfo;
1956 return SourceRange(getLParenLoc(), getRParenLoc());
1961 setRParenLoc(Range.
getEnd());
1977 DeducedTemplateSpecializationTypeLoc,
1978 DeducedTemplateSpecializationType> {
1981 return getNameLoc();
1999 ElaboratedLocInfo> {
2002 return this->getLocalData()->ElaboratedKWLoc;
2006 this->getLocalData()->ElaboratedKWLoc = Loc;
2011 getLocalData()->QualifierData);
2017 "Inconsistent nested-name-specifier pointer");
2018 getLocalData()->QualifierData = QualifierLoc.
getOpaqueData();
2022 if (getElaboratedKeywordLoc().isValid())
2023 if (getQualifierLoc())
2029 return getQualifierLoc().getSourceRange();
2035 return getInnerTypeLoc();
2056 DependentNameTypeLoc,
2058 DependentNameLocInfo> {
2061 return this->getLocalData()->ElaboratedKWLoc;
2065 this->getLocalData()->ElaboratedKWLoc = Loc;
2070 getLocalData()->QualifierData);
2076 "Inconsistent nested-name-specifier pointer");
2077 getLocalData()->QualifierData = QualifierLoc.
getOpaqueData();
2081 return this->getLocalData()->NameLoc;
2085 this->getLocalData()->NameLoc = Loc;
2089 if (getElaboratedKeywordLoc().isValid())
2090 return SourceRange(getElaboratedKeywordLoc(), getNameLoc());
2113 DependentTemplateSpecializationTypeLoc,
2114 DependentTemplateSpecializationType,
2115 DependentTemplateSpecializationLocInfo> {
2118 return this->getLocalData()->ElaboratedKWLoc;
2122 this->getLocalData()->ElaboratedKWLoc = Loc;
2126 if (!getLocalData()->QualifierData)
2130 getLocalData()->QualifierData);
2134 if (!QualifierLoc) {
2139 getLocalData()->QualifierData =
nullptr;
2145 "Inconsistent nested-name-specifier pointer");
2146 getLocalData()->QualifierData = QualifierLoc.
getOpaqueData();
2150 return getLocalData()->TemplateKWLoc;
2154 getLocalData()->TemplateKWLoc = Loc;
2158 return this->getLocalData()->NameLoc;
2162 this->getLocalData()->NameLoc = Loc;
2166 return this->getLocalData()->LAngleLoc;
2170 this->getLocalData()->LAngleLoc = Loc;
2174 return this->getLocalData()->RAngleLoc;
2178 this->getLocalData()->RAngleLoc = Loc;
2186 getArgInfos()[i] = AI;
2190 return getArgInfos()[i];
2198 if (getElaboratedKeywordLoc().isValid())
2199 return SourceRange(getElaboratedKeywordLoc(), getRAngleLoc());
2200 else if (getQualifierLoc())
2202 else if (getTemplateKeywordLoc().isValid())
2203 return SourceRange(getTemplateKeywordLoc(), getRAngleLoc());
2205 return SourceRange(getTemplateNameLoc(), getRAngleLoc());
2236 PackExpansionType, PackExpansionTypeLocInfo> {
2239 return this->getLocalData()->EllipsisLoc;
2243 this->getLocalData()->EllipsisLoc = Loc;
2247 return SourceRange(getEllipsisLoc(), getEllipsisLoc());
2251 setEllipsisLoc(Loc);
2255 return getInnerTypeLoc();
2268 AtomicType, AtomicTypeLocInfo> {
2271 return this->getInnerTypeLoc();
2279 return this->getLocalData()->KWLoc;
2283 this->getLocalData()->KWLoc = Loc;
2287 return this->getLocalData()->LParenLoc;
2291 this->getLocalData()->LParenLoc = Loc;
2295 return this->getLocalData()->RParenLoc;
2299 this->getLocalData()->RParenLoc = Loc;
2303 return SourceRange(getLParenLoc(), getRParenLoc());
2308 setRParenLoc(Range.
getEnd());
2343 template <
typename T>
2346 while (!T::isKind(Cur)) {
2348 Cur = PTL.getInnerLoc();
2350 Cur = ATL.getModifiedLoc();
2352 Cur = ETL.getNamedTypeLoc();
2354 Cur = ATL.getOriginalLoc();
2363 #endif // LLVM_CLANG_AST_TYPELOC_H ObjCInterfaceDecl * getIFaceDecl() const
unsigned getExtraLocalDataSize() const
SourceRange getLocalSourceRange() const
SourceLocation getNameLoc() const
TemplateTypeParmDecl * getDecl() const
TypeLoc getValueLoc() const
unsigned getExtraLocalDataAlignment() const
SourceRange OperandParens
static unsigned getFullDataSizeForType(QualType Ty)
Returns the size of type source info data block for the given type.
SourceRange getExceptionSpecRange() const
unsigned getLocalDataSize() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
const TypeClass * getTypePtr() const
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
TypeSourceInfo * ClassTInfo
A (possibly-)qualified type.
void setStarLoc(SourceLocation Loc)
SourceLocation TypeArgsRAngleLoc
Wrapper for source info for tag types.
const TypeClass * getTypePtr() const
void setNameEndLoc(SourceLocation Loc)
SourceLocation getKWLoc() const
SourceRange getLocalSourceRange() const
void setKWLoc(SourceLocation Loc)
void setRParenLoc(SourceLocation Loc)
TypeLoc getNextTypeLoc() const
Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the TypeLoc is a PointerLoc and next Typ...
void setStarLoc(SourceLocation Loc)
void setLAngleLoc(SourceLocation Loc)
void setExceptionSpecRange(SourceRange R)
unsigned getLocalDataSize() const
Returns the size of the type source info data block that is specific to this type.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
TypeLoc getValueLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
C Language Family Type Representation.
void setWrittenWidthSpec(TypeSpecifierWidth written)
WrittenBuiltinSpecs & getWrittenBuiltinSpecs()
HasNoInnerType getInnerType() const
SourceLocation ProtocolLAngleLoc
TypeLocClass getTypeLocClass() const
The base class of the type hierarchy.
void setTemplateKeywordLoc(SourceLocation Loc)
Wrapper for source info for typedefs.
TypeLoc getOriginalLoc() const
A container of type source information.
unsigned EnumOperandLoc
A raw SourceLocation.
unsigned getExtraLocalDataSize() const
Wrapper for source info for pointers decayed from arrays and functions.
SourceLocation LocalRangeEnd
SourceLocation getEndLoc() const
Get the end source location.
bool hasBaseTypeAsWritten() const
bool isCompleteDefinition() const
isCompleteDefinition - Return true if this decl has its body fully specified.
void setParensRange(SourceRange range)
SourceLocation getRParenLoc() const
void initialize(ASTContext &Context, SourceLocation Loc) const
Initializes this to state that every location in this type is the given location. ...
Wrapper for source info for member pointers.
Wrapper of type source information for a type with non-trivial direct qualifiers. ...
SourceRange getLocalSourceRange() const
TypeSpecifierType
Specifies the kind of type.
SourceLocation getStarLoc() const
ArrayRef< SourceLocation > getProtocolLocs() const
TypeLoc getNamedTypeLoc() const
void setAttrOperandParensRange(SourceRange range)
void setProtocolRAngleLoc(SourceLocation Loc)
void setBegin(SourceLocation b)
SourceRange getLocalSourceRange() const
Expr * getAttrExprOperand() const
The attribute's expression operand, if it has one.
ParmVarDecl - Represents a parameter to a function.
void initializeLocal(ASTContext &Context, SourceLocation loc)
SourceLocation NameEndLoc
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
A reasonable base class for TypeLocs that correspond to types that are written as a type-specifier...
SourceLocation getAmpAmpLoc() const
void setTypeArgTInfo(unsigned i, TypeSourceInfo *TInfo)
const Type * getTypePtr() const
bool needsExtraLocalData() const
void setParensRange(SourceRange Range)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
Base wrapper for a particular "section" of type source info.
RecordDecl - Represents a struct/union/class.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
unsigned getExtraLocalDataSize() const
TypeSpecifierSign getWrittenSignSpec() const
unsigned getExtraLocalDataSize() const
Returns the size of the type source info data block that is specific to this type.
void setLocalRangeEnd(SourceLocation L)
Expr * getUnderlyingExpr() const
SourceRange getLocalSourceRange() const
SourceLocation TypeArgsLAngleLoc
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
TypeLoc getInnerLoc() const
void setBuiltinLoc(SourceLocation Loc)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
TypeSpecifierSign
Specifies the signedness of a type, e.g., signed or unsigned.
TypeSourceInfo * getUnderlyingTInfo() const
void setRBracketLoc(SourceLocation Loc)
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
SourceRange getLocalSourceRange() const
SourceLocation RBracketLoc
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
QualType getInnerType() const
SourceLocation getProtocolLAngleLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
void setElaboratedKeywordLoc(SourceLocation Loc)
SourceLocation getProtocolRAngleLoc() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
ParmVarDecl * getParam(unsigned i) const
Wrapper for source info for unresolved typename using decls.
SourceLocation getRParenLoc() const
TypeLoc getNextTypeLoc() const
ArrayRef< SourceLocation > getProtocolLocs() const
void copy(DependentTemplateSpecializationTypeLoc Loc)
Wrapper of type source information for a type with no direct qualifiers.
Expr * getAttrExprOperand() const
The attribute's expression operand, if it has one.
unsigned getExtraLocalDataAlignment() const
SourceLocation getLParenLoc() const
SourceLocation getLAngleLoc() const
TypeSpecifierWidth getWrittenWidthSpec() const
void setProtocolLoc(unsigned i, SourceLocation Loc)
void setLParenLoc(SourceLocation Loc)
void setNameLoc(SourceLocation Loc)
SourceLocation getLParenLoc() const
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
unsigned getNumProtocols() const
SourceLocation getProtocolLoc(unsigned i) const
SourceLocation getSigilLoc() const
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
const Type * getClass() 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.
SourceLocation getElaboratedKeywordLoc() const
Wrapper for substituted template type parameters.
Wrapper for substituted template type parameters.
SourceLocation getLParenLoc() const
unsigned getExtraLocalDataAlignment() const
void setRParenLoc(SourceLocation Loc)
TypeLoc(const Type *ty, void *opaqueData)
void expandBuiltinRange(SourceRange Range)
SourceRange getLocalSourceRange() const
SourceLocation getTemplateKeywordLoc() const
CXXRecordDecl * getDecl() const
Wrapper for source info for ObjC interfaces.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getInnerType() const
QualType getInnerType() const
Returns the type before the address space attribute application area.
void setNameLoc(SourceLocation Loc)
Represents an Objective-C protocol declaration.
SourceLocation getNameLoc() const
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
void setProtocolLoc(unsigned i, SourceLocation Loc)
TemplateArgumentLoc getArgLoc(unsigned i) const
bool isDefinition() const
True if the tag was defined in this type specifier.
void setLocalRangeBegin(SourceLocation L)
Represents an ObjC class declaration.
void copy(ElaboratedTypeLoc Loc)
SourceLocation findNullabilityLoc() const
Find the location of the nullability specifier (__nonnull, __nullable, or __null_unspecifier), if there is one.
unsigned getNumArgs() const
SourceLocation getProtocolRAngleLoc() const
SourceLocation LocalRangeBegin
SourceLocation getElaboratedKeywordLoc() const
void setAttrNameLoc(SourceLocation loc)
SourceLocation getNameEndLoc() const
SourceRange getLocalSourceRange() const
SourceLocation getTemplateKeywordLoc() const
void * getOpaqueData() const
Get the pointer where source information is stored.
SourceLocation getBuiltinLoc() const
TypeLoc getInnerTypeLoc() const
ObjCProtocolDecl * getProtocol(unsigned i) const
SourceRange getLocalSourceRange() const
void * QualifierData
Data associated with the nested-name-specifier location.
SourceRange getLocalSourceRange() const
Get the local source range.
SourceLocation getNameLoc() const
EnumDecl * getDecl() const
void setSizeExpr(Expr *Size)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
QualType getInnerType() const
void setAttrNameLoc(SourceLocation loc)
void setTemplateNameLoc(SourceLocation Loc)
void setAttrExprOperand(Expr *e)
TagDecl * getDecl() const
SourceLocation getBeginLoc() const
Get the begin source location.
bool hasWrittenSignSpec() const
SourceLocation getTemplateNameLoc() const
Type source information for an attributed type.
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
Expr - This represents one expression.
SourceLocation getLocalRangeEnd() const
void setModeAttr(bool written)
const FunctionProtoType * T
SourceLocation EllipsisLoc
Declaration of a template type parameter.
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
SourceRange getBracketsRange() const
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
bool hasWrittenTypeSpec() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setWrittenSignSpec(TypeSpecifierSign written)
SourceLocation getCaretLoc() const
SourceLocation getEllipsisLoc() const
SourceRange getLocalSourceRange() const
void setRParenLoc(SourceLocation Loc)
char __ovld __cnfn min(char x, char y)
Returns y if y < x, otherwise it returns x.
void setNameLoc(SourceLocation Loc)
void setLParenLoc(SourceLocation Loc)
SourceLocation getLocalRangeBegin() const
Wrapper for source info for enum types.
SourceLocation getProtocolLAngleLoc() const
void setEllipsisLoc(SourceLocation Loc)
void setAttrExprOperand(Expr *e)
ProtocolLAngleLoc, ProtocolRAngleLoc, and the source locations for protocol qualifiers are stored aft...
void setHasBaseTypeAsWritten(bool HasBaseType)
SourceLocation getEnd() const
SourceRange getLocalSourceRange() 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...
T getAsAdjusted() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLock is not of the desire...
TypeLoc getReturnLoc() const
SourceRange getLocalSourceRange() const
AttributedType::Kind getAttrKind() const
bool hasAttrExprOperand() const
void setStarLoc(SourceLocation Loc)
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
void setTypeofLoc(SourceLocation Loc)
SourceRange getLocalSourceRange() const
Wrapper for source info for arrays.
SourceRange getLocalSourceRange() const
void setAttrOperandParensRange(SourceRange range)
SourceLocation getTemplateNameLoc() const
QualType getInnerType() const
TypeLoc getPatternLoc() const
unsigned getExtraLocalDataSize() const
TypeLoc IgnoreParens() const
void * getExtraLocalData() const
Gets a pointer past the Info structure; useful for classes with local data that can't be captured in ...
void setLAngleLoc(SourceLocation Loc)
Encodes a location in the source.
SourceLocation getStarLoc() const
SourceRange OperandParens
SourceRange getLocalSourceRange() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
void setProtocolLAngleLoc(SourceLocation Loc)
TagDecl - Represents the declaration of a struct/union/class/enum.
void setProtocolRAngleLoc(SourceLocation Loc)
A metaprogramming base class for TypeLoc classes which correspond to a particular Type subclass...
SourceLocation getRParenLoc() const
friend bool operator!=(const TypeLoc &LHS, const TypeLoc &RHS)
RecordDecl * getDecl() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceLocation ProtocolRAngleLoc
SourceLocation getStarLoc() const
QualType getInnerType() const
SourceRange getLocalSourceRange() const
UnqualTypeLoc(const Type *Ty, void *Data)
bool hasWrittenWidthSpec() const
TypeLocClass
The kinds of TypeLocs.
void setElaboratedKeywordLoc(SourceLocation Loc)
QualType getInnerType() const
void setWrittenTypeSpec(TypeSpecifierType written)
void setAmpLoc(SourceLocation Loc)
void setLBracketLoc(SourceLocation Loc)
SourceLocation ElaboratedKWLoc
TypeClass getTypeClass() const
unsigned getExtraLocalDataAlignment() const
SourceLocation getRAngleLoc() const
TypeLoc findExplicitQualifierLoc() const
Find a type with the location of an explicit type qualifier.
A metaprogramming class designed for concrete subtypes of abstract types where all subtypes share equ...
ArrayRef< ParmVarDecl * > getParams() const
unsigned getFullDataSize() const
Returns the size of the type source info data block.
static QualType getFromOpaquePtr(const void *Ptr)
QualType getInnerType() const
TypeLoc getElementLoc() const
Defines various enumerations that describe declaration and type specifiers.
void setLParenLoc(SourceLocation Loc)
void setTemplateKeywordLoc(SourceLocation Loc)
TypeLoc(QualType ty, void *opaqueData)
void setTypeArgsLAngleLoc(SourceLocation Loc)
Base class for declarations which introduce a typedef-name.
SourceLocation getTypeofLoc() const
Represents a template argument.
unsigned getLocalDataAlignment() const
ParmVarDecl ** getParmArray() const
TypeSourceInfo * getClassTInfo() const
void setClassTInfo(TypeSourceInfo *TI)
const Type * getTypePtr() const
QualType getInnerType() const
void initializeLocal(ASTContext &Context, SourceLocation loc)
Dataflow Directional Tag Classes.
SourceLocation TemplateKWLoc
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool isValid() const
Return true if this is a valid SourceLocation object.
void setAmpAmpLoc(SourceLocation Loc)
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getType() const
Get the type for which this source info wrapper provides information.
SourceLocation getLocStart() const LLVM_READONLY
SourceRange getLocalSourceRange() const
TemplateArgumentLoc getArgLoc(unsigned i) const
QualType getInnerType() const
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
SourceLocation getRAngleLoc() const
Represents a dependent using declaration which was marked with typename.
Represents the declaration of an Objective-C type parameter.
void * getNonLocalData() const
LocalData * getLocalData() const
EnumDecl - Represents an enum.
void setSigilLoc(SourceLocation Loc)
TypeLoc getModifiedLoc() const
The modified type, which is generally canonically different from the attribute type.
SourceRange getLocalSourceRange() const
ObjCTypeParamDecl * getDecl() const
TypeLoc getPointeeTypeLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
SourceLocation getElaboratedKeywordLoc() const
unsigned getNumParams() const
void setNameLoc(SourceLocation Loc)
SourceLocation getRBracketLoc() const
bool hasAttrEnumOperand() const
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
unsigned getExtraLocalDataAlignment() const
TypeLoc getPointeeLoc() const
void setAttrEnumOperandLoc(SourceLocation loc)
Location wrapper for a TemplateArgument.
SourceRange getLocalSourceRange() const
static bool classof(const OMPClause *T)
TypeSourceInfo * getTypeArgTInfo(unsigned i) const
TypedefNameDecl * getTypedefNameDecl() const
SourceLocation getTemplateNameLoc() const
SourceLocation getKWLoc() const
SourceLocation getRParenLoc() const
void setTemplateNameLoc(SourceLocation Loc)
const WrittenBuiltinSpecs & getWrittenBuiltinSpecs() const
unsigned getLocalDataSize() const
SourceLocation getProtocolLoc(unsigned i) const
Expr * getSizeExpr() const
TypeLocClass getTypeLocClass() const
void setTypeArgsRAngleLoc(SourceLocation Loc)
Wrapper for source info for record types.
UnresolvedUsingTypenameDecl * getDecl() const
SourceLocation getLBracketLoc() const
void copy(TemplateSpecializationTypeLoc Loc)
Copy the location information from the given info.
Wraps an ObjCPointerType with source location information.
unsigned getNumArgs() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
QualType getInnerType() const
SourceLocation getLParenLoc() const
char __ovld __cnfn max(char x, char y)
Returns y if x < y, otherwise it returns x.
TypeLoc getBaseLoc() const
Structure that packs information about the type specifiers that were written in a particular type spe...
UnqualTypeLoc getUnqualifiedLoc() const
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
SourceLocation getLAngleLoc() const
void * getOpaqueData() const
Retrieve the opaque pointer that refers to source-location data.
SourceLocation getTypeArgsLAngleLoc() const
void setKWLoc(SourceLocation Loc)
QualType getInnerType() const
SourceRange getParensRange() const
Defines the clang::SourceLocation class and associated facilities.
void setEnd(SourceLocation e)
Represents a C++ struct/union/class.
TypeSpecifierWidth
Specifies the width of a type, e.g., short, long, or long long.
QualType getInnerType() const
void setParam(unsigned i, ParmVarDecl *VD)
void copyLocal(TypeLoc other)
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
static unsigned getLocalAlignmentForType(QualType Ty)
Returns the alignment of type source info data block for the given type.
TypeLoc getNextTypeLoc() const
void copyLocal(Derived other)
SourceRange getLocalSourceRange() const
unsigned getExtraLocalDataAlignment() const
unsigned getNumProtocols() const
void setLParenLoc(SourceLocation Loc)
Location information for a TemplateArgument.
void initializeLocal(ASTContext &Context, SourceLocation Loc)
bool hasAttrOperand() const
unsigned getExtraLocalDataSize() const
SourceLocation getNameLoc() const
QualType getUnderlyingType() const
void setRAngleLoc(SourceLocation Loc)
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
SourceLocation TemplateKWLoc
unsigned getNumTypeArgs() const
ObjCProtocolDecl * getProtocol(unsigned i) const
SourceLocation getAmpLoc() const
void copy(TypeLoc other)
Copies the other type loc into this one.
void setProtocolLAngleLoc(SourceLocation Loc)
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
void initializeFullCopy(TypeLoc Other)
Initializes this by copying its information from another TypeLoc of the same type.
unsigned getExtraLocalDataAlignment() 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.
void copy(DependentNameTypeLoc Loc)
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type...
void setTemplateNameLoc(SourceLocation Loc)
NestedNameSpecifierLoc getQualifierLoc() const
Expr * getUnderlyingExpr() const
void initializeLocal(ASTContext &Context, SourceLocation Loc)
SourceRange getLocalSourceRange() const
void initializeFullCopy(TypeLoc Other, unsigned Size)
Initializes this by copying its information from another TypeLoc of the same type.
unsigned getExtraLocalDataSize() const
SourceRange getParensRange() const
SourceLocation getAttrEnumOperandLoc() const
The location of the attribute's enumerated operand, if it has one.
SourceLocation getNameLoc() const
SourceRange getLocalSourceRange() const
Wrapper for source info for pointers.
SourceLocation getBegin() const
unsigned getLocalDataAlignment() const
Returns the alignment of the type source info data block that is specific to this type...
Wrapper for source info for block pointers.
void setElaboratedKeywordLoc(SourceLocation Loc)
SourceLocation getLocation() const
SourceLocation getTypeArgsRAngleLoc() const
void setUnderlyingTInfo(TypeSourceInfo *TI) const
SourceRange getParensRange() const