clang 22.0.0git
TypeLoc.h
Go to the documentation of this file.
1//===- TypeLoc.h - Type Source Info Wrapper ---------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// Defines the clang::TypeLoc interface and its subclasses.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_AST_TYPELOC_H
15#define LLVM_CLANG_AST_TYPELOC_H
16
21#include "clang/AST/TypeBase.h"
22#include "clang/Basic/LLVM.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"
29#include <algorithm>
30#include <cassert>
31#include <cstdint>
32#include <cstring>
33
34namespace clang {
35
36class Attr;
37class ASTContext;
38class CXXRecordDecl;
39class ConceptDecl;
40class Expr;
41class ObjCInterfaceDecl;
42class ObjCProtocolDecl;
43class ObjCTypeParamDecl;
44class ParmVarDecl;
45class TemplateTypeParmDecl;
46class UnqualTypeLoc;
47class UnresolvedUsingTypenameDecl;
48
49// Predeclare all the type nodes.
50#define ABSTRACT_TYPELOC(Class, Base)
51#define TYPELOC(Class, Base) \
52 class Class##TypeLoc;
53#include "clang/AST/TypeLocNodes.def"
54
55/// Base wrapper for a particular "section" of type source info.
56///
57/// A client should use the TypeLoc subclasses through castAs()/getAs()
58/// in order to get at the actual information.
59class TypeLoc {
60protected:
61 // The correctness of this relies on the property that, for Type *Ty,
62 // QualType(Ty, 0).getAsOpaquePtr() == (void*) Ty
63 const void *Ty = nullptr;
64 void *Data = nullptr;
65
66public:
67 TypeLoc() = default;
68 TypeLoc(QualType ty, void *opaqueData)
69 : Ty(ty.getAsOpaquePtr()), Data(opaqueData) {}
70 TypeLoc(const Type *ty, void *opaqueData)
71 : Ty(ty), Data(opaqueData) {}
72
73 /// Convert to the specified TypeLoc type, asserting that this TypeLoc
74 /// is of the desired type.
75 ///
76 /// \pre T::isKind(*this)
77 template<typename T>
78 T castAs() const {
79 assert(T::isKind(*this));
80 T t;
81 TypeLoc& tl = t;
82 tl = *this;
83 return t;
84 }
85
86 /// Convert to the specified TypeLoc type, returning a null TypeLoc if
87 /// this TypeLoc is not of the desired type.
88 template<typename T>
89 T getAs() const {
90 if (!T::isKind(*this))
91 return {};
92 T t;
93 TypeLoc& tl = t;
94 tl = *this;
95 return t;
96 }
97
98 /// Convert to the specified TypeLoc type, returning a null TypeLoc if
99 /// this TypeLoc is not of the desired type. It will consider type
100 /// adjustments from a type that was written as a T to another type that is
101 /// still canonically a T (ignores parens, attributes, elaborated types, etc).
102 template <typename T>
103 T getAsAdjusted() const;
104
105 /// The kinds of TypeLocs. Equivalent to the Type::TypeClass enum,
106 /// except it also defines a Qualified enum that corresponds to the
107 /// QualifiedLoc class.
109#define ABSTRACT_TYPE(Class, Base)
110#define TYPE(Class, Base) \
111 Class = Type::Class,
112#include "clang/AST/TypeNodes.inc"
114 };
115
117 if (getType().hasLocalQualifiers()) return Qualified;
118 return (TypeLocClass) getType()->getTypeClass();
119 }
120
121 bool isNull() const { return !Ty; }
122 explicit operator bool() const { return Ty; }
123
124 /// Returns the size of type source info data block for the given type.
125 static unsigned getFullDataSizeForType(QualType Ty);
126
127 /// Returns the alignment of type source info data block for
128 /// the given type.
129 static unsigned getLocalAlignmentForType(QualType Ty);
130
131 /// Get the type for which this source info wrapper provides
132 /// information.
135 }
136
137 const Type *getTypePtr() const {
139 }
140
141 /// Get the pointer where source information is stored.
142 // FIXME: This should provide a type-safe interface.
143 void *getOpaqueData() const {
144 return Data;
145 }
146
147 /// Get the begin source location.
149
150 /// Get the end source location.
152
153 /// Get the full source range.
154 SourceRange getSourceRange() const LLVM_READONLY {
155 return SourceRange(getBeginLoc(), getEndLoc());
156 }
157
158
159 /// Get the local source range.
161 return getLocalSourceRangeImpl(*this);
162 }
163
164 /// Returns the size of the type source info data block.
165 unsigned getFullDataSize() const {
167 }
168
169 /// Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the
170 /// TypeLoc is a PointerLoc and next TypeLoc is for "int".
172 return getNextTypeLocImpl(*this);
173 }
174
175 /// Skips past any qualifiers, if this is qualified.
176 UnqualTypeLoc getUnqualifiedLoc() const; // implemented in this header
177
178 TypeLoc IgnoreParens() const;
179
180 /// Find a type with the location of an explicit type qualifier.
181 ///
182 /// The result, if non-null, will be one of:
183 /// QualifiedTypeLoc
184 /// AtomicTypeLoc
185 /// AttributedTypeLoc, for those type attributes that behave as qualifiers
187
188 /// Get the typeloc of an AutoType whose type will be deduced for a variable
189 /// with an initializer of this type. This looks through declarators like
190 /// pointer types, but not through decltype or typedefs.
192
193 /// Get the SourceLocation of the template keyword (if any).
195
196 /// If this type represents a qualified-id, this returns it's nested name
197 /// specifier. For example, for the qualified-id "foo::bar::baz", this returns
198 /// "foo::bar". Returns null if this type represents an unqualified-id.
200
201 /// This returns the position of the type after any elaboration, such as the
202 /// 'struct' keyword, and name qualifiers. This will the 'template' keyword if
203 /// present, or the name location otherwise.
205
206 /// This returns the position of the type after any elaboration, such as the
207 /// 'struct' keyword. This may be the position of the name qualifiers,
208 /// 'template' keyword, or the name location otherwise.
210
211 /// Initializes this to state that every location in this
212 /// type is the given location.
213 ///
214 /// This method exists to provide a simple transition for code that
215 /// relies on location-less types.
216 void initialize(ASTContext &Context, SourceLocation Loc) const {
217 initializeImpl(Context, *this, Loc);
218 }
219
220 /// Initializes this by copying its information from another
221 /// TypeLoc of the same type.
223 assert(getType() == Other.getType());
224 copy(Other);
225 }
226
227 /// Initializes this by copying its information from another
228 /// TypeLoc of the same type. The given size must be the full data
229 /// size.
230 void initializeFullCopy(TypeLoc Other, unsigned Size) {
231 assert(getType() == Other.getType());
232 assert(getFullDataSize() == Size);
233 copy(Other);
234 }
235
236 /// Copies the other type loc into this one.
237 void copy(TypeLoc other);
238
239 friend bool operator==(const TypeLoc &LHS, const TypeLoc &RHS) {
240 return LHS.Ty == RHS.Ty && LHS.Data == RHS.Data;
241 }
242
243 friend bool operator!=(const TypeLoc &LHS, const TypeLoc &RHS) {
244 return !(LHS == RHS);
245 }
246
247 /// Find the location of the nullability specifier (__nonnull,
248 /// __nullable, or __null_unspecifier), if there is one.
250
251 void dump() const;
252 void dump(llvm::raw_ostream &, const ASTContext &) const;
253
254private:
255 static bool isKind(const TypeLoc&) {
256 return true;
257 }
258
259 static void initializeImpl(ASTContext &Context, TypeLoc TL,
260 SourceLocation Loc);
261 static TypeLoc getNextTypeLocImpl(TypeLoc TL);
262 static TypeLoc IgnoreParensImpl(TypeLoc TL);
263 static SourceRange getLocalSourceRangeImpl(TypeLoc TL);
264};
265
266inline TypeSourceInfo::TypeSourceInfo(QualType ty, size_t DataSize) : Ty(ty) {
267 // Init data attached to the object. See getTypeLoc.
268 memset(static_cast<void *>(this + 1), 0, DataSize);
269}
270
271/// Return the TypeLoc for a type source info.
273 // TODO: is this alignment already sufficient?
274 return TypeLoc(Ty, const_cast<void*>(static_cast<const void*>(this + 1)));
275}
276
277/// Wrapper of type source information for a type with
278/// no direct qualifiers.
279class UnqualTypeLoc : public TypeLoc {
280public:
281 UnqualTypeLoc() = default;
282 UnqualTypeLoc(const Type *Ty, void *Data) : TypeLoc(Ty, Data) {}
283
284 const Type *getTypePtr() const {
285 return reinterpret_cast<const Type*>(Ty);
286 }
287
290 }
291
292private:
293 friend class TypeLoc;
294
295 static bool isKind(const TypeLoc &TL) {
296 return !TL.getType().hasLocalQualifiers();
297 }
298};
299
300/// Wrapper of type source information for a type with
301/// non-trivial direct qualifiers.
302///
303/// Currently, we intentionally do not provide source location for
304/// type qualifiers.
305class QualifiedTypeLoc : public TypeLoc {
306public:
307 SourceRange getLocalSourceRange() const { return {}; }
308
310 unsigned align =
312 auto dataInt = reinterpret_cast<uintptr_t>(Data);
313 dataInt = llvm::alignTo(dataInt, align);
314 return UnqualTypeLoc(getTypePtr(), reinterpret_cast<void*>(dataInt));
315 }
316
317 /// Initializes the local data of this type source info block to
318 /// provide no information.
320 // do nothing
321 }
322
323 void copyLocal(TypeLoc other) {
324 // do nothing
325 }
326
328 return getUnqualifiedLoc();
329 }
330
331 /// Returns the size of the type source info data block that is
332 /// specific to this type.
333 unsigned getLocalDataSize() const {
334 // In fact, we don't currently preserve any location information
335 // for qualifiers.
336 return 0;
337 }
338
339 /// Returns the alignment of the type source info data block that is
340 /// specific to this type.
341 unsigned getLocalDataAlignment() const {
342 // We don't preserve any location information.
343 return 1;
344 }
345
346private:
347 friend class TypeLoc;
348
349 static bool isKind(const TypeLoc &TL) {
350 return TL.getType().hasLocalQualifiers();
351 }
352};
353
355 if (QualifiedTypeLoc Loc = getAs<QualifiedTypeLoc>())
356 return Loc.getUnqualifiedLoc();
357 return castAs<UnqualTypeLoc>();
358}
359
360/// A metaprogramming base class for TypeLoc classes which correspond
361/// to a particular Type subclass. It is accepted for a single
362/// TypeLoc class to correspond to multiple Type classes.
363///
364/// \tparam Base a class from which to derive
365/// \tparam Derived the class deriving from this one
366/// \tparam TypeClass the concrete Type subclass associated with this
367/// location type
368/// \tparam LocalData the structure type of local location data for
369/// this type
370///
371/// TypeLocs with non-constant amounts of local data should override
372/// getExtraLocalDataSize(); getExtraLocalData() will then point to
373/// this extra memory.
374///
375/// TypeLocs with an inner type should define
376/// QualType getInnerType() const
377/// and getInnerTypeLoc() will then point to this inner type's
378/// location data.
379///
380/// A word about hierarchies: this template is not designed to be
381/// derived from multiple times in a hierarchy. It is also not
382/// designed to be used for classes where subtypes might provide
383/// different amounts of source information. It should be subclassed
384/// only at the deepest portion of the hierarchy where all children
385/// have identical source information; if that's an abstract type,
386/// then further descendents should inherit from
387/// InheritingConcreteTypeLoc instead.
388template <class Base, class Derived, class TypeClass, class LocalData>
389class ConcreteTypeLoc : public Base {
390 friend class TypeLoc;
391
392 const Derived *asDerived() const {
393 return static_cast<const Derived*>(this);
394 }
395
396 static bool isKind(const TypeLoc &TL) {
397 return !TL.getType().hasLocalQualifiers() &&
398 Derived::classofType(TL.getTypePtr());
399 }
400
401 static bool classofType(const Type *Ty) {
402 return TypeClass::classof(Ty);
403 }
404
405public:
406 unsigned getLocalDataAlignment() const {
407 return std::max(unsigned(alignof(LocalData)),
408 asDerived()->getExtraLocalDataAlignment());
409 }
410
411 unsigned getLocalDataSize() const {
412 unsigned size = sizeof(LocalData);
413 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
414 size = llvm::alignTo(size, extraAlign);
415 size += asDerived()->getExtraLocalDataSize();
416 size = llvm::alignTo(size, asDerived()->getLocalDataAlignment());
417 return size;
418 }
419
420 void copyLocal(Derived other) {
421 // Some subclasses have no data to copy.
422 if (asDerived()->getLocalDataSize() == 0) return;
423
424 // Copy the fixed-sized local data.
425 memcpy(getLocalData(), other.getLocalData(), sizeof(LocalData));
426
427 // Copy the variable-sized local data. We need to do this
428 // separately because the padding in the source and the padding in
429 // the destination might be different.
430 memcpy(getExtraLocalData(), other.getExtraLocalData(),
431 asDerived()->getExtraLocalDataSize());
432 }
433
435 return getNextTypeLoc(asDerived()->getInnerType());
436 }
437
438 const TypeClass *getTypePtr() const {
439 return cast<TypeClass>(Base::getTypePtr());
440 }
441
442protected:
443 unsigned getExtraLocalDataSize() const {
444 return 0;
445 }
446
447 unsigned getExtraLocalDataAlignment() const {
448 return 1;
449 }
450
451 LocalData *getLocalData() const {
452 return static_cast<LocalData*>(Base::Data);
453 }
454
455 /// Gets a pointer past the Info structure; useful for classes with
456 /// local data that can't be captured in the Info (e.g. because it's
457 /// of variable size).
458 void *getExtraLocalData() const {
459 unsigned size = sizeof(LocalData);
460 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
461 size = llvm::alignTo(size, extraAlign);
462 return reinterpret_cast<char *>(Base::Data) + size;
463 }
464
465 void *getNonLocalData() const {
466 auto data = reinterpret_cast<uintptr_t>(Base::Data);
467 data += asDerived()->getLocalDataSize();
468 data = llvm::alignTo(data, getNextTypeAlign());
469 return reinterpret_cast<void*>(data);
470 }
471
472 struct HasNoInnerType {};
474
476 return TypeLoc(asDerived()->getInnerType(), getNonLocalData());
477 }
478
479private:
480 unsigned getInnerTypeSize() const {
481 return getInnerTypeSize(asDerived()->getInnerType());
482 }
483
484 unsigned getInnerTypeSize(HasNoInnerType _) const {
485 return 0;
486 }
487
488 unsigned getInnerTypeSize(QualType _) const {
490 }
491
492 unsigned getNextTypeAlign() const {
493 return getNextTypeAlign(asDerived()->getInnerType());
494 }
495
496 unsigned getNextTypeAlign(HasNoInnerType _) const {
497 return 1;
498 }
499
500 unsigned getNextTypeAlign(QualType T) const {
502 }
503
504 TypeLoc getNextTypeLoc(HasNoInnerType _) const { return {}; }
505
506 TypeLoc getNextTypeLoc(QualType T) const {
507 return TypeLoc(T, getNonLocalData());
508 }
509};
510
511/// A metaprogramming class designed for concrete subtypes of abstract
512/// types where all subtypes share equivalently-structured source
513/// information. See the note on ConcreteTypeLoc.
514template <class Base, class Derived, class TypeClass>
516 friend class TypeLoc;
517
518 static bool classofType(const Type *Ty) {
519 return TypeClass::classof(Ty);
520 }
521
522 static bool isKind(const TypeLoc &TL) {
523 return !TL.getType().hasLocalQualifiers() &&
524 Derived::classofType(TL.getTypePtr());
525 }
526 static bool isKind(const UnqualTypeLoc &TL) {
527 return Derived::classofType(TL.getTypePtr());
528 }
529
530public:
531 const TypeClass *getTypePtr() const {
532 return cast<TypeClass>(Base::getTypePtr());
533 }
534};
535
538};
539
540/// A reasonable base class for TypeLocs that correspond to
541/// types that are written as a type-specifier.
542class TypeSpecTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
543 TypeSpecTypeLoc,
544 Type,
545 TypeSpecLocInfo> {
546public:
547 enum {
550 };
551
553 return this->getLocalData()->NameLoc;
554 }
555
557 this->getLocalData()->NameLoc = Loc;
558 }
559
561 return SourceRange(getNameLoc(), getNameLoc());
562 }
563
566 }
567
568private:
569 friend class TypeLoc;
570
571 static bool isKind(const TypeLoc &TL);
572};
573
576};
577
578/// Wrapper for source info for builtin types.
579class BuiltinTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
580 BuiltinTypeLoc,
581 BuiltinType,
582 BuiltinLocInfo> {
583public:
586 }
587
590 }
591
593 SourceRange &BuiltinRange = getLocalData()->BuiltinRange;
594 if (!BuiltinRange.getBegin().isValid()) {
595 BuiltinRange = Range;
596 } else {
597 BuiltinRange.setBegin(std::min(Range.getBegin(), BuiltinRange.getBegin()));
598 BuiltinRange.setEnd(std::max(Range.getEnd(), BuiltinRange.getEnd()));
599 }
600 }
601
603
605 return *(static_cast<WrittenBuiltinSpecs*>(getExtraLocalData()));
606 }
608 return *(static_cast<WrittenBuiltinSpecs*>(getExtraLocalData()));
609 }
610
611 bool needsExtraLocalData() const {
613 return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128) ||
614 (bk >= BuiltinType::Short && bk <= BuiltinType::Ibm128) ||
615 bk == BuiltinType::UChar || bk == BuiltinType::SChar;
616 }
617
618 unsigned getExtraLocalDataSize() const {
619 return needsExtraLocalData() ? sizeof(WrittenBuiltinSpecs) : 0;
620 }
621
622 unsigned getExtraLocalDataAlignment() const {
623 return needsExtraLocalData() ? alignof(WrittenBuiltinSpecs) : 1;
624 }
625
627 return getLocalData()->BuiltinRange;
628 }
629
632 return static_cast<TypeSpecifierSign>(getWrittenBuiltinSpecs().Sign);
633 else
635 }
636
637 bool hasWrittenSignSpec() const {
639 }
640
643 getWrittenBuiltinSpecs().Sign = static_cast<unsigned>(written);
644 }
645
648 return static_cast<TypeSpecifierWidth>(getWrittenBuiltinSpecs().Width);
649 else
651 }
652
653 bool hasWrittenWidthSpec() const {
655 }
656
659 getWrittenBuiltinSpecs().Width = static_cast<unsigned>(written);
660 }
661
663
664 bool hasWrittenTypeSpec() const {
666 }
667
670 getWrittenBuiltinSpecs().Type = written;
671 }
672
673 bool hasModeAttr() const {
676 else
677 return false;
678 }
679
680 void setModeAttr(bool written) {
683 }
684
687 if (needsExtraLocalData()) {
689 wbs.Sign = static_cast<unsigned>(TypeSpecifierSign::Unspecified);
690 wbs.Width = static_cast<unsigned>(TypeSpecifierWidth::Unspecified);
691 wbs.Type = TST_unspecified;
692 wbs.ModeAttr = false;
693 }
694 }
695};
696
700
703 NestedNameSpecifierLoc QualifierLoc,
706 QualifierData(QualifierLoc.getOpaqueData()) {}
709 : NameLoc(Loc),
712 QualifierData(getTrivialQualifierData(Context, Qualifier, Loc)) {}
713
715 assert(!Qualifier == !QualifierData);
716 return NestedNameSpecifierLoc(Qualifier, QualifierData);
717 }
718
721 if (NestedNameSpecifierLoc QualifierLoc = getQualifierLoc(Qualifier);
722 BeginLoc.isInvalid() && Qualifier)
723 BeginLoc = QualifierLoc.getBeginLoc();
724 if (BeginLoc.isInvalid())
725 BeginLoc = NameLoc;
726 return SourceRange(BeginLoc, NameLoc);
727 }
728
729private:
730 void *QualifierData;
731
732 static void *getTrivialQualifierData(ASTContext &Context,
733 NestedNameSpecifier Qualifier,
735 if (!Qualifier)
736 return nullptr;
738 Builder.MakeTrivial(Context, Qualifier, Loc);
739 return Builder.getWithLocInContext(Context).getOpaqueData();
740 }
741};
742
743template <class TL, class T>
745 : public ConcreteTypeLoc<UnqualTypeLoc, TL, T, ElaboratedNameLocInfo> {
746public:
747 auto *getDecl() const { return this->getTypePtr()->getDecl(); }
748
749 void set(SourceLocation ElaboratedKeywordLoc,
750 NestedNameSpecifierLoc QualifierLoc, SourceLocation NameLoc) {
751 assert(QualifierLoc.getNestedNameSpecifier() ==
752 this->getTypePtr()->getQualifier());
753 *this->getLocalData() =
754 ElaboratedNameLocInfo(ElaboratedKeywordLoc, QualifierLoc, NameLoc);
755 }
756
758 return this->getLocalData()->ElaboratedKeywordLoc;
759 }
760
762 return this->getLocalData()->getQualifierLoc(
763 this->getTypePtr()->getQualifier());
764 }
765
766 SourceLocation getNameLoc() const { return this->getLocalData()->NameLoc; }
767
769 return this->getLocalData()->getLocalSourceRange(
770 this->getTypePtr()->getQualifier());
771 }
772
774 const auto *Ptr = this->getTypePtr();
775 *this->getLocalData() = ElaboratedNameLocInfo(Context, Ptr->getKeyword(),
776 Ptr->getQualifier(), Loc);
777 }
778};
779
780/// Wrapper for source info for typedefs.
782 : public ElaboratedNameTypeLoc<TypedefTypeLoc, TypedefType> {};
783
784/// Wrapper for source info for unresolved typename using decls.
786 : public ElaboratedNameTypeLoc<UnresolvedUsingTypeLoc,
787 UnresolvedUsingType> {};
788
789/// Wrapper for source info for types used via transparent aliases.
790class UsingTypeLoc : public ElaboratedNameTypeLoc<UsingTypeLoc, UsingType> {};
791
796};
797
798class TagTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, TagTypeLoc, TagType,
799 TagTypeLocInfo> {
800public:
802
803 /// True if the tag was defined in this type specifier.
804 bool isDefinition() const;
805
808 }
809
812 }
813
816 void *QualifierData = getLocalData()->QualifierData;
817 assert(!Qualifier == !QualifierData);
818 return NestedNameSpecifierLoc(Qualifier, QualifierData);
819 }
820
822 assert(QualifierLoc.getNestedNameSpecifier() ==
823 getTypePtr()->getQualifier());
824 getLocalData()->QualifierData = QualifierLoc.getOpaqueData();
825 }
826
828
830
833 if (NestedNameSpecifierLoc Qualifier = getQualifierLoc();
834 BeginLoc.isInvalid() && Qualifier)
835 BeginLoc = Qualifier.getBeginLoc();
836 if (BeginLoc.isInvalid())
837 BeginLoc = getNameLoc();
838 return SourceRange(BeginLoc, getNameLoc());
839 }
840
842 setElaboratedKeywordLoc(getTypePtr()->getKeyword() !=
844 ? Loc
845 : SourceLocation());
846 if (NestedNameSpecifier Qualifier = getTypePtr()->getQualifier()) {
848 Builder.MakeTrivial(Context, Qualifier, Loc);
849 setQualifierLoc(Builder.getWithLocInContext(Context));
850 } else {
851 getLocalData()->QualifierData = nullptr;
852 }
854 }
855};
856
857/// Wrapper for source info for record types.
858class RecordTypeLoc : public InheritingConcreteTypeLoc<TagTypeLoc,
859 RecordTypeLoc,
860 RecordType> {
861public:
863 return getTypePtr()->getOriginalDecl();
864 }
865};
866
867/// Wrapper for source info for enum types.
868class EnumTypeLoc : public InheritingConcreteTypeLoc<TagTypeLoc,
869 EnumTypeLoc,
870 EnumType> {
871public:
873};
874
875/// Wrapper for source info for injected class names of class
876/// templates.
878 : public InheritingConcreteTypeLoc<TagTypeLoc, InjectedClassNameTypeLoc,
879 InjectedClassNameType> {
880public:
882 return getTypePtr()->getOriginalDecl();
883 }
884};
885
886/// Wrapper for template type parameters.
888 public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
889 TemplateTypeParmTypeLoc,
890 TemplateTypeParmType> {
891public:
893};
894
897};
898
899/// ProtocolLAngleLoc, ProtocolRAngleLoc, and the source locations for
900/// protocol qualifiers are stored after Info.
901class ObjCTypeParamTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
902 ObjCTypeParamTypeLoc,
903 ObjCTypeParamType,
904 ObjCTypeParamTypeLocInfo> {
905 // SourceLocations are stored after Info, one for each protocol qualifier.
906 SourceLocation *getProtocolLocArray() const {
907 return (SourceLocation*)this->getExtraLocalData() + 2;
908 }
909
910public:
911 ObjCTypeParamDecl *getDecl() const { return getTypePtr()->getDecl(); }
912
914 return this->getLocalData()->NameLoc;
915 }
916
918 this->getLocalData()->NameLoc = Loc;
919 }
920
922 return getNumProtocols() ?
923 *((SourceLocation*)this->getExtraLocalData()) :
925 }
926
928 *((SourceLocation*)this->getExtraLocalData()) = Loc;
929 }
930
932 return getNumProtocols() ?
933 *((SourceLocation*)this->getExtraLocalData() + 1) :
935 }
936
938 *((SourceLocation*)this->getExtraLocalData() + 1) = Loc;
939 }
940
941 unsigned getNumProtocols() const {
942 return this->getTypePtr()->getNumProtocols();
943 }
944
945 SourceLocation getProtocolLoc(unsigned i) const {
946 assert(i < getNumProtocols() && "Index is out of bounds!");
947 return getProtocolLocArray()[i];
948 }
949
951 assert(i < getNumProtocols() && "Index is out of bounds!");
952 getProtocolLocArray()[i] = Loc;
953 }
954
955 ObjCProtocolDecl *getProtocol(unsigned i) const {
956 assert(i < getNumProtocols() && "Index is out of bounds!");
957 return *(this->getTypePtr()->qual_begin() + i);
958 }
959
961 return {getProtocolLocArray(), getNumProtocols()};
962 }
963
965
966 unsigned getExtraLocalDataSize() const {
967 if (!this->getNumProtocols()) return 0;
968 // When there are protocol qualifers, we have LAngleLoc and RAngleLoc
969 // as well.
970 return (this->getNumProtocols() + 2) * sizeof(SourceLocation) ;
971 }
972
973 unsigned getExtraLocalDataAlignment() const {
974 return alignof(SourceLocation);
975 }
976
978 SourceLocation start = getNameLoc();
980 if (end.isInvalid()) return SourceRange(start, start);
981 return SourceRange(start, end);
982 }
983};
984
985/// Wrapper for substituted template type parameters.
987 public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
988 SubstTemplateTypeParmTypeLoc,
989 SubstTemplateTypeParmType> {
990};
991
992/// Abstract type representing delayed type pack expansions.
994 : public InheritingConcreteTypeLoc<TypeSpecTypeLoc, SubstPackTypeLoc,
995 SubstPackType> {};
996
997/// Wrapper for substituted template type parameters.
999 : public InheritingConcreteTypeLoc<SubstPackTypeLoc,
1000 SubstTemplateTypeParmPackTypeLoc,
1001 SubstTemplateTypeParmPackType> {};
1002
1003/// Wrapper for substituted template type parameters.
1005 : public InheritingConcreteTypeLoc<SubstPackTypeLoc,
1006 SubstBuiltinTemplatePackTypeLoc,
1007 SubstBuiltinTemplatePackType> {};
1008
1011};
1012
1013/// Type source information for an attributed type.
1014class AttributedTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
1015 AttributedTypeLoc,
1016 AttributedType,
1017 AttributedLocInfo> {
1018public:
1020 return getTypePtr()->getAttrKind();
1021 }
1022
1023 bool isQualifier() const {
1024 return getTypePtr()->isQualifier();
1025 }
1026
1027 /// The modified type, which is generally canonically different from
1028 /// the attribute type.
1029 /// int main(int, char**) __attribute__((noreturn))
1030 /// ~~~ ~~~~~~~~~~~~~
1032 return getInnerTypeLoc();
1033 }
1034
1036 return TypeLoc(getTypePtr()->getEquivalentType(), getNonLocalData());
1037 }
1038
1039 /// The type attribute.
1040 const Attr *getAttr() const {
1041 return getLocalData()->TypeAttr;
1042 }
1043 void setAttr(const Attr *A) {
1044 getLocalData()->TypeAttr = A;
1045 }
1046
1047 template<typename T> const T *getAttrAs() {
1048 return dyn_cast_or_null<T>(getAttr());
1049 }
1050
1052
1054 setAttr(nullptr);
1055 }
1056
1058 return getTypePtr()->getModifiedType();
1059 }
1060};
1061
1062struct BTFTagAttributedLocInfo {}; // Nothing.
1063
1064/// Type source information for an btf_tag attributed type.
1066 : public ConcreteTypeLoc<UnqualTypeLoc, BTFTagAttributedTypeLoc,
1067 BTFTagAttributedType, BTFTagAttributedLocInfo> {
1068public:
1070
1071 /// The btf_type_tag attribute.
1072 const BTFTypeTagAttr *getAttr() const { return getTypePtr()->getAttr(); }
1073
1074 template <typename T> T *getAttrAs() {
1075 return dyn_cast_or_null<T>(getAttr());
1076 }
1077
1079
1081
1083};
1084
1088};
1089
1090/// Type source information for HLSL attributed resource type.
1092 : public ConcreteTypeLoc<UnqualTypeLoc, HLSLAttributedResourceTypeLoc,
1093 HLSLAttributedResourceType,
1094 HLSLAttributedResourceLocInfo> {
1095public:
1097
1099 return getLocalData()->ContainedTyInfo;
1100 }
1103 }
1104
1109 }
1111 unsigned getLocalDataSize() const {
1112 return sizeof(HLSLAttributedResourceLocInfo);
1113 }
1114};
1115
1118}; // Nothing.
1119
1121 : public ConcreteTypeLoc<UnqualTypeLoc, HLSLInlineSpirvTypeLoc,
1122 HLSLInlineSpirvType, HLSLInlineSpirvTypeLocInfo> {
1123public:
1125 void setSpirvTypeLoc(SourceLocation loc) const { getLocalData()->Loc = loc; }
1126
1129 }
1131 setSpirvTypeLoc(loc);
1132 }
1133};
1134
1141};
1142
1143// A helper class for defining ObjC TypeLocs that can qualified with
1144// protocols.
1145//
1146// TypeClass basically has to be either ObjCInterfaceType or
1147// ObjCObjectPointerType.
1148class ObjCObjectTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
1149 ObjCObjectTypeLoc,
1150 ObjCObjectType,
1151 ObjCObjectTypeLocInfo> {
1152 // TypeSourceInfo*'s are stored after Info, one for each type argument.
1153 TypeSourceInfo **getTypeArgLocArray() const {
1154 return (TypeSourceInfo**)this->getExtraLocalData();
1155 }
1156
1157 // SourceLocations are stored after the type argument information, one for
1158 // each Protocol.
1159 SourceLocation *getProtocolLocArray() const {
1160 return (SourceLocation*)(getTypeArgLocArray() + getNumTypeArgs());
1161 }
1162
1163public:
1165 return this->getLocalData()->TypeArgsLAngleLoc;
1166 }
1167
1170 }
1171
1173 return this->getLocalData()->TypeArgsRAngleLoc;
1174 }
1175
1178 }
1179
1180 unsigned getNumTypeArgs() const {
1181 return this->getTypePtr()->getTypeArgsAsWritten().size();
1182 }
1183
1184 TypeSourceInfo *getTypeArgTInfo(unsigned i) const {
1185 assert(i < getNumTypeArgs() && "Index is out of bounds!");
1186 return getTypeArgLocArray()[i];
1187 }
1188
1189 void setTypeArgTInfo(unsigned i, TypeSourceInfo *TInfo) {
1190 assert(i < getNumTypeArgs() && "Index is out of bounds!");
1191 getTypeArgLocArray()[i] = TInfo;
1192 }
1193
1195 return this->getLocalData()->ProtocolLAngleLoc;
1196 }
1197
1200 }
1201
1203 return this->getLocalData()->ProtocolRAngleLoc;
1204 }
1205
1208 }
1209
1210 unsigned getNumProtocols() const {
1211 return this->getTypePtr()->getNumProtocols();
1212 }
1213
1214 SourceLocation getProtocolLoc(unsigned i) const {
1215 assert(i < getNumProtocols() && "Index is out of bounds!");
1216 return getProtocolLocArray()[i];
1217 }
1218
1220 assert(i < getNumProtocols() && "Index is out of bounds!");
1221 getProtocolLocArray()[i] = Loc;
1222 }
1223
1224 ObjCProtocolDecl *getProtocol(unsigned i) const {
1225 assert(i < getNumProtocols() && "Index is out of bounds!");
1226 return *(this->getTypePtr()->qual_begin() + i);
1227 }
1228
1229
1231 return {getProtocolLocArray(), getNumProtocols()};
1232 }
1233
1236 }
1237
1238 void setHasBaseTypeAsWritten(bool HasBaseType) {
1239 getLocalData()->HasBaseTypeAsWritten = HasBaseType;
1240 }
1241
1243 return getInnerTypeLoc();
1244 }
1245
1248 if (start.isInvalid())
1249 start = getProtocolLAngleLoc();
1251 if (end.isInvalid())
1252 end = getTypeArgsRAngleLoc();
1253 return SourceRange(start, end);
1254 }
1255
1257
1258 unsigned getExtraLocalDataSize() const {
1259 return this->getNumTypeArgs() * sizeof(TypeSourceInfo *)
1260 + this->getNumProtocols() * sizeof(SourceLocation);
1261 }
1262
1264 static_assert(alignof(ObjCObjectTypeLoc) >= alignof(TypeSourceInfo *),
1265 "not enough alignment for tail-allocated data");
1266 return alignof(TypeSourceInfo *);
1267 }
1268
1270 return getTypePtr()->getBaseType();
1271 }
1272};
1273
1277};
1278
1279/// Wrapper for source info for ObjC interfaces.
1280class ObjCInterfaceTypeLoc : public ConcreteTypeLoc<ObjCObjectTypeLoc,
1281 ObjCInterfaceTypeLoc,
1282 ObjCInterfaceType,
1283 ObjCInterfaceLocInfo> {
1284public:
1286 return getTypePtr()->getDecl();
1287 }
1288
1290 return getLocalData()->NameLoc;
1291 }
1292
1295 }
1296
1299 }
1300
1302 return getLocalData()->NameEndLoc;
1303 }
1304
1307 }
1308
1310 setNameLoc(Loc);
1312 }
1313};
1314
1317 : public ConcreteTypeLoc<UnqualTypeLoc, BoundsAttributedTypeLoc,
1318 BoundsAttributedType, BoundsAttributedLocInfo> {
1319public:
1321 QualType getInnerType() const { return getTypePtr()->desugar(); }
1323 // nothing to do
1324 }
1325 // LocalData is empty and TypeLocBuilder doesn't handle DataSize 1.
1326 unsigned getLocalDataSize() const { return 0; }
1327};
1328
1330 : public InheritingConcreteTypeLoc<BoundsAttributedTypeLoc,
1331 CountAttributedTypeLoc,
1332 CountAttributedType> {
1333public:
1334 Expr *getCountExpr() const { return getTypePtr()->getCountExpr(); }
1335 bool isCountInBytes() const { return getTypePtr()->isCountInBytes(); }
1336 bool isOrNull() const { return getTypePtr()->isOrNull(); }
1337
1339};
1340
1343};
1344
1346 : public ConcreteTypeLoc<UnqualTypeLoc, MacroQualifiedTypeLoc,
1347 MacroQualifiedType, MacroQualifiedLocInfo> {
1348public:
1351 }
1352
1354
1356 return getTypePtr()->getMacroIdentifier();
1357 }
1358
1360 return this->getLocalData()->ExpansionLoc;
1361 }
1362
1364 this->getLocalData()->ExpansionLoc = Loc;
1365 }
1366
1368
1371 }
1372};
1373
1377};
1378
1380 : public ConcreteTypeLoc<UnqualTypeLoc, ParenTypeLoc, ParenType,
1381 ParenLocInfo> {
1382public:
1384 return this->getLocalData()->LParenLoc;
1385 }
1386
1388 return this->getLocalData()->RParenLoc;
1389 }
1390
1392 this->getLocalData()->LParenLoc = Loc;
1393 }
1394
1396 this->getLocalData()->RParenLoc = Loc;
1397 }
1398
1401 }
1402
1406 }
1407
1409 return getInnerTypeLoc();
1410 }
1411
1413 return this->getTypePtr()->getInnerType();
1414 }
1415};
1416
1418 if (ParenTypeLoc::isKind(*this))
1419 return IgnoreParensImpl(*this);
1420 return *this;
1421}
1422
1423struct AdjustedLocInfo {}; // Nothing.
1424
1425class AdjustedTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, AdjustedTypeLoc,
1426 AdjustedType, AdjustedLocInfo> {
1427public:
1429 return getInnerTypeLoc();
1430 }
1431
1433 // do nothing
1434 }
1435
1437 // The inner type is the undecayed type, since that's what we have source
1438 // location information for.
1439 return getTypePtr()->getOriginalType();
1440 }
1441
1442 SourceRange getLocalSourceRange() const { return {}; }
1443
1444 unsigned getLocalDataSize() const {
1445 // sizeof(AdjustedLocInfo) is 1, but we don't need its address to be unique
1446 // anyway. TypeLocBuilder can't handle data sizes of 1.
1447 return 0; // No data.
1448 }
1449};
1450
1451/// Wrapper for source info for pointers decayed from arrays and
1452/// functions.
1454 AdjustedTypeLoc, DecayedTypeLoc, DecayedType> {
1455};
1456
1459};
1460
1461/// A base class for
1462template <class Derived, class TypeClass, class LocalData = PointerLikeLocInfo>
1463class PointerLikeTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, Derived,
1464 TypeClass, LocalData> {
1465public:
1467 return this->getLocalData()->StarLoc;
1468 }
1469
1471 this->getLocalData()->StarLoc = Loc;
1472 }
1473
1475 return this->getInnerTypeLoc();
1476 }
1477
1479 return SourceRange(getSigilLoc(), getSigilLoc());
1480 }
1481
1484 }
1485
1487 return this->getTypePtr()->getPointeeType();
1488 }
1489};
1490
1491/// Wrapper for source info for pointers.
1492class PointerTypeLoc : public PointerLikeTypeLoc<PointerTypeLoc,
1493 PointerType> {
1494public:
1496 return getSigilLoc();
1497 }
1498
1501 }
1502};
1503
1504/// Wrapper for source info for block pointers.
1505class BlockPointerTypeLoc : public PointerLikeTypeLoc<BlockPointerTypeLoc,
1506 BlockPointerType> {
1507public:
1509 return getSigilLoc();
1510 }
1511
1514 }
1515};
1516
1518 void *QualifierData = nullptr;
1519};
1520
1521/// Wrapper for source info for member pointers.
1522class MemberPointerTypeLoc : public PointerLikeTypeLoc<MemberPointerTypeLoc,
1523 MemberPointerType,
1524 MemberPointerLocInfo> {
1525public:
1527 return getSigilLoc();
1528 }
1529
1532 }
1533
1535 return NestedNameSpecifierLoc(getTypePtr()->getQualifier(),
1536 getLocalData()->QualifierData);
1537 }
1538
1540 assert(QualifierLoc.getNestedNameSpecifier() ==
1541 getTypePtr()->getQualifier() &&
1542 "Inconsistent nested-name-specifier pointer");
1543 getLocalData()->QualifierData = QualifierLoc.getOpaqueData();
1544 }
1545
1548 if (NestedNameSpecifier Qualifier = getTypePtr()->getQualifier()) {
1550 Builder.MakeTrivial(Context, Qualifier, Loc);
1551 setQualifierLoc(Builder.getWithLocInContext(Context));
1552 } else
1553 getLocalData()->QualifierData = nullptr;
1554 }
1555
1558 return SourceRange(QL.getBeginLoc(), getStarLoc());
1559 return SourceRange(getStarLoc());
1560 }
1561};
1562
1563/// Wraps an ObjCPointerType with source location information.
1565 public PointerLikeTypeLoc<ObjCObjectPointerTypeLoc,
1566 ObjCObjectPointerType> {
1567public:
1569 return getSigilLoc();
1570 }
1571
1574 }
1575};
1576
1577class ReferenceTypeLoc : public PointerLikeTypeLoc<ReferenceTypeLoc,
1578 ReferenceType> {
1579public:
1581 return getTypePtr()->getPointeeTypeAsWritten();
1582 }
1583};
1584
1586 public InheritingConcreteTypeLoc<ReferenceTypeLoc,
1587 LValueReferenceTypeLoc,
1588 LValueReferenceType> {
1589public:
1591 return getSigilLoc();
1592 }
1593
1596 }
1597};
1598
1600 public InheritingConcreteTypeLoc<ReferenceTypeLoc,
1601 RValueReferenceTypeLoc,
1602 RValueReferenceType> {
1603public:
1605 return getSigilLoc();
1606 }
1607
1610 }
1611};
1612
1618};
1619
1620/// Wrapper for source info for functions.
1621class FunctionTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
1622 FunctionTypeLoc,
1623 FunctionType,
1624 FunctionLocInfo> {
1625 bool hasExceptionSpec() const {
1626 if (auto *FPT = dyn_cast<FunctionProtoType>(getTypePtr())) {
1627 return FPT->hasExceptionSpec();
1628 }
1629 return false;
1630 }
1631
1632 SourceRange *getExceptionSpecRangePtr() const {
1633 assert(hasExceptionSpec() && "No exception spec range");
1634 // After the Info comes the ParmVarDecl array, and after that comes the
1635 // exception specification information.
1636 return (SourceRange *)(getParmArray() + getNumParams());
1637 }
1638
1639public:
1641 return getLocalData()->LocalRangeBegin;
1642 }
1643
1646 }
1647
1649 return getLocalData()->LocalRangeEnd;
1650 }
1651
1654 }
1655
1657 return this->getLocalData()->LParenLoc;
1658 }
1659
1661 this->getLocalData()->LParenLoc = Loc;
1662 }
1663
1665 return this->getLocalData()->RParenLoc;
1666 }
1667
1669 this->getLocalData()->RParenLoc = Loc;
1670 }
1671
1674 }
1675
1677 if (hasExceptionSpec())
1678 return *getExceptionSpecRangePtr();
1679 return {};
1680 }
1681
1683 if (hasExceptionSpec())
1684 *getExceptionSpecRangePtr() = R;
1685 }
1686
1688 return {getParmArray(), getNumParams()};
1689 }
1690
1691 // ParmVarDecls* are stored after Info, one for each parameter.
1693 return (ParmVarDecl**) getExtraLocalData();
1694 }
1695
1696 unsigned getNumParams() const {
1697 if (isa<FunctionNoProtoType>(getTypePtr()))
1698 return 0;
1699 return cast<FunctionProtoType>(getTypePtr())->getNumParams();
1700 }
1701
1702 ParmVarDecl *getParam(unsigned i) const { return getParmArray()[i]; }
1703 void setParam(unsigned i, ParmVarDecl *VD) { getParmArray()[i] = VD; }
1704
1706 return getInnerTypeLoc();
1707 }
1708
1711 }
1712
1718 for (unsigned i = 0, e = getNumParams(); i != e; ++i)
1719 setParam(i, nullptr);
1720 if (hasExceptionSpec())
1722 }
1723
1724 /// Returns the size of the type source info data block that is
1725 /// specific to this type.
1726 unsigned getExtraLocalDataSize() const {
1727 unsigned ExceptSpecSize = hasExceptionSpec() ? sizeof(SourceRange) : 0;
1728 return (getNumParams() * sizeof(ParmVarDecl *)) + ExceptSpecSize;
1729 }
1730
1731 unsigned getExtraLocalDataAlignment() const { return alignof(ParmVarDecl *); }
1732
1734};
1735
1737 public InheritingConcreteTypeLoc<FunctionTypeLoc,
1738 FunctionProtoTypeLoc,
1739 FunctionProtoType> {
1740};
1741
1743 public InheritingConcreteTypeLoc<FunctionTypeLoc,
1744 FunctionNoProtoTypeLoc,
1745 FunctionNoProtoType> {
1746};
1747
1751};
1752
1753/// Wrapper for source info for arrays.
1754class ArrayTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
1755 ArrayTypeLoc,
1756 ArrayType,
1757 ArrayLocInfo> {
1758public:
1760 return getLocalData()->LBracketLoc;
1761 }
1762
1765 }
1766
1768 return getLocalData()->RBracketLoc;
1769 }
1770
1773 }
1774
1777 }
1778
1780 return getLocalData()->Size;
1781 }
1782
1783 void setSizeExpr(Expr *Size) {
1784 getLocalData()->Size = Size;
1785 }
1786
1788 return getInnerTypeLoc();
1789 }
1790
1793 }
1794
1798 setSizeExpr(nullptr);
1799 }
1800
1802};
1803
1805 public InheritingConcreteTypeLoc<ArrayTypeLoc,
1806 ConstantArrayTypeLoc,
1807 ConstantArrayType> {
1808};
1809
1810/// Wrapper for source info for array parameter types.
1813 ConstantArrayTypeLoc, ArrayParameterTypeLoc, ArrayParameterType> {};
1814
1816 public InheritingConcreteTypeLoc<ArrayTypeLoc,
1817 IncompleteArrayTypeLoc,
1818 IncompleteArrayType> {
1819};
1820
1822 public InheritingConcreteTypeLoc<ArrayTypeLoc,
1823 DependentSizedArrayTypeLoc,
1824 DependentSizedArrayType> {
1825public:
1829 }
1830};
1831
1833 public InheritingConcreteTypeLoc<ArrayTypeLoc,
1834 VariableArrayTypeLoc,
1835 VariableArrayType> {
1836};
1837
1838// Location information for a TemplateName. Rudimentary for now.
1841};
1842
1849};
1850
1852 public ConcreteTypeLoc<UnqualTypeLoc,
1853 TemplateSpecializationTypeLoc,
1854 TemplateSpecializationType,
1855 TemplateSpecializationLocInfo> {
1856public:
1857 void set(SourceLocation ElaboratedKeywordLoc,
1858 NestedNameSpecifierLoc QualifierLoc,
1859 SourceLocation TemplateKeywordLoc, SourceLocation NameLoc,
1860 SourceLocation LAngleLoc, SourceLocation RAngleLoc);
1861
1862 void set(SourceLocation ElaboratedKeywordLoc,
1863 NestedNameSpecifierLoc QualifierLoc,
1864 SourceLocation TemplateKeywordLoc, SourceLocation NameLoc,
1865 const TemplateArgumentListInfo &TAL);
1866
1868 return getLocalData()->ElaboratedKWLoc;
1869 }
1870
1872 if (!getLocalData()->QualifierData)
1873 return NestedNameSpecifierLoc();
1874
1875 NestedNameSpecifier Qualifier =
1877 assert(Qualifier && "missing qualification");
1878 return NestedNameSpecifierLoc(Qualifier, getLocalData()->QualifierData);
1879 }
1880
1882 return getLocalData()->TemplateKWLoc;
1883 }
1884
1886
1888
1889 unsigned getNumArgs() const {
1890 return getTypePtr()->template_arguments().size();
1891 }
1892
1894 return {getArgInfos(), getNumArgs()};
1895 }
1896
1897 TemplateArgumentLoc getArgLoc(unsigned i) const {
1898 return TemplateArgumentLoc(getTypePtr()->template_arguments()[i],
1899 getArgInfos()[i]);
1900 }
1901
1903
1904 /// - Copy the location information from the given info.
1906 unsigned size = getFullDataSize();
1907 assert(size == Loc.getFullDataSize());
1908
1909 // We're potentially copying Expr references here. We don't
1910 // bother retaining them because TypeSourceInfos live forever, so
1911 // as long as the Expr was retained when originally written into
1912 // the TypeLoc, we're okay.
1913 memcpy(Data, Loc.Data, size);
1914 }
1915
1917
1919
1920 static void initializeArgLocs(ASTContext &Context,
1922 TemplateArgumentLocInfo *ArgInfos,
1924
1925 unsigned getExtraLocalDataSize() const {
1926 return getNumArgs() * sizeof(TemplateArgumentLocInfo);
1927 }
1928
1930 return alignof(TemplateArgumentLocInfo);
1931 }
1932
1933private:
1934 TemplateArgumentLocInfo *getArgInfos() const {
1935 return static_cast<TemplateArgumentLocInfo*>(getExtraLocalData());
1936 }
1937};
1938
1943};
1944
1946 : public ConcreteTypeLoc<UnqualTypeLoc,
1947 DependentAddressSpaceTypeLoc,
1948 DependentAddressSpaceType,
1949 DependentAddressSpaceLocInfo> {
1950public:
1951 /// The location of the attribute name, i.e.
1952 /// int * __attribute__((address_space(11)))
1953 /// ^~~~~~~~~~~~~
1955 return getLocalData()->AttrLoc;
1956 }
1958 getLocalData()->AttrLoc = loc;
1959 }
1960
1961 /// The attribute's expression operand, if it has one.
1962 /// int * __attribute__((address_space(11)))
1963 /// ^~
1965 return getLocalData()->ExprOperand;
1966 }
1969 }
1970
1971 /// The location of the parentheses around the operand, if there is
1972 /// an operand.
1973 /// int * __attribute__((address_space(11)))
1974 /// ^ ^
1976 return getLocalData()->OperandParens;
1977 }
1979 getLocalData()->OperandParens = range;
1980 }
1981
1983 SourceRange range(getAttrNameLoc());
1984 range.setEnd(getAttrOperandParensRange().getEnd());
1985 return range;
1986 }
1987
1988 /// Returns the type before the address space attribute application
1989 /// area.
1990 /// int * __attribute__((address_space(11))) *
1991 /// ^ ^
1993 return this->getTypePtr()->getPointeeType();
1994 }
1995
1997 return this->getInnerTypeLoc();
1998 }
1999
2001 setAttrNameLoc(loc);
2004 setAttrExprOperand(getTypePtr()->getAddrSpaceExpr());
2005 }
2006};
2007
2008//===----------------------------------------------------------------------===//
2009//
2010// All of these need proper implementations.
2011//
2012//===----------------------------------------------------------------------===//
2013
2014// FIXME: size expression and attribute locations (or keyword if we
2015// ever fully support altivec syntax).
2018};
2019
2020class VectorTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, VectorTypeLoc,
2021 VectorType, VectorTypeLocInfo> {
2022public:
2023 SourceLocation getNameLoc() const { return this->getLocalData()->NameLoc; }
2024
2026
2028 return SourceRange(getNameLoc(), getNameLoc());
2029 }
2030
2032 setNameLoc(Loc);
2033 }
2034
2036
2037 QualType getInnerType() const { return this->getTypePtr()->getElementType(); }
2038};
2039
2040// FIXME: size expression and attribute locations (or keyword if we
2041// ever fully support altivec syntax).
2043 : public ConcreteTypeLoc<UnqualTypeLoc, DependentVectorTypeLoc,
2044 DependentVectorType, VectorTypeLocInfo> {
2045public:
2046 SourceLocation getNameLoc() const { return this->getLocalData()->NameLoc; }
2047
2049
2051 return SourceRange(getNameLoc(), getNameLoc());
2052 }
2053
2055 setNameLoc(Loc);
2056 }
2057
2059
2060 QualType getInnerType() const { return this->getTypePtr()->getElementType(); }
2061};
2062
2063// FIXME: size expression and attribute locations.
2065 : public InheritingConcreteTypeLoc<VectorTypeLoc, ExtVectorTypeLoc,
2066 ExtVectorType> {};
2067
2068// FIXME: attribute locations.
2069// For some reason, this isn't a subtype of VectorType.
2071 : public ConcreteTypeLoc<UnqualTypeLoc, DependentSizedExtVectorTypeLoc,
2072 DependentSizedExtVectorType, VectorTypeLocInfo> {
2073public:
2074 SourceLocation getNameLoc() const { return this->getLocalData()->NameLoc; }
2075
2077
2079 return SourceRange(getNameLoc(), getNameLoc());
2080 }
2081
2083 setNameLoc(Loc);
2084 }
2085
2087
2088 QualType getInnerType() const { return this->getTypePtr()->getElementType(); }
2089};
2090
2096};
2097
2098class MatrixTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, MatrixTypeLoc,
2099 MatrixType, MatrixTypeLocInfo> {
2100public:
2101 /// The location of the attribute name, i.e.
2102 /// float __attribute__((matrix_type(4, 2)))
2103 /// ^~~~~~~~~~~~~~~~~
2106
2107 /// The attribute's row operand, if it has one.
2108 /// float __attribute__((matrix_type(4, 2)))
2109 /// ^
2112
2113 /// The attribute's column operand, if it has one.
2114 /// float __attribute__((matrix_type(4, 2)))
2115 /// ^
2118
2119 /// The location of the parentheses around the operand, if there is
2120 /// an operand.
2121 /// float __attribute__((matrix_type(4, 2)))
2122 /// ^ ^
2124 return getLocalData()->OperandParens;
2125 }
2127 getLocalData()->OperandParens = range;
2128 }
2129
2131 SourceRange range(getAttrNameLoc());
2132 range.setEnd(getAttrOperandParensRange().getEnd());
2133 return range;
2134 }
2135
2137 setAttrNameLoc(loc);
2139 setAttrRowOperand(nullptr);
2140 setAttrColumnOperand(nullptr);
2141 }
2142};
2143
2145 : public InheritingConcreteTypeLoc<MatrixTypeLoc, ConstantMatrixTypeLoc,
2146 ConstantMatrixType> {};
2147
2149 : public InheritingConcreteTypeLoc<MatrixTypeLoc,
2150 DependentSizedMatrixTypeLoc,
2151 DependentSizedMatrixType> {};
2152
2153// FIXME: location of the '_Complex' keyword.
2154class ComplexTypeLoc : public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
2155 ComplexTypeLoc,
2156 ComplexType> {
2157};
2158
2163};
2164
2166};
2167
2170};
2171
2172template <class Derived, class TypeClass, class LocalData = TypeofLocInfo>
2174 : public ConcreteTypeLoc<UnqualTypeLoc, Derived, TypeClass, LocalData> {
2175public:
2177 return this->getLocalData()->TypeofLoc;
2178 }
2179
2181 this->getLocalData()->TypeofLoc = Loc;
2182 }
2183
2185 return this->getLocalData()->LParenLoc;
2186 }
2187
2189 this->getLocalData()->LParenLoc = Loc;
2190 }
2191
2193 return this->getLocalData()->RParenLoc;
2194 }
2195
2197 this->getLocalData()->RParenLoc = Loc;
2198 }
2199
2202 }
2203
2205 setLParenLoc(range.getBegin());
2206 setRParenLoc(range.getEnd());
2207 }
2208
2211 }
2212
2217 }
2218};
2219
2220class TypeOfExprTypeLoc : public TypeofLikeTypeLoc<TypeOfExprTypeLoc,
2221 TypeOfExprType,
2222 TypeOfExprTypeLocInfo> {
2223public:
2225 return getTypePtr()->getUnderlyingExpr();
2226 }
2227
2228 // Reimplemented to account for GNU/C++ extension
2229 // typeof unary-expression
2230 // where there are no parentheses.
2232};
2233
2235 : public TypeofLikeTypeLoc<TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo> {
2236public:
2238 return this->getTypePtr()->getUnmodifiedType();
2239 }
2240
2242 return this->getLocalData()->UnmodifiedTInfo;
2243 }
2244
2246 this->getLocalData()->UnmodifiedTInfo = TI;
2247 }
2248
2250};
2251
2252// decltype(expression) abc;
2253// ~~~~~~~~ DecltypeLoc
2254// ~ RParenLoc
2255// FIXME: add LParenLoc, it is tricky to support due to the limitation of
2256// annotated-decltype token.
2260};
2262 : public ConcreteTypeLoc<UnqualTypeLoc, DecltypeTypeLoc, DecltypeType,
2263 DecltypeTypeLocInfo> {
2264public:
2266
2269
2272
2275 }
2276
2280 }
2281};
2282
2285};
2286
2288 : public ConcreteTypeLoc<UnqualTypeLoc, PackIndexingTypeLoc,
2289 PackIndexingType, PackIndexingTypeLocInfo> {
2290
2291public:
2292 Expr *getIndexExpr() const { return getTypePtr()->getIndexExpr(); }
2293 QualType getPattern() const { return getTypePtr()->getPattern(); }
2294
2297
2300 }
2301
2303
2304 QualType getInnerType() const { return this->getTypePtr()->getPattern(); }
2305
2308 }
2309};
2310
2312 // FIXME: While there's only one unary transform right now, future ones may
2313 // need different representations
2316};
2317
2318class UnaryTransformTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
2319 UnaryTransformTypeLoc,
2320 UnaryTransformType,
2321 UnaryTransformTypeLocInfo> {
2322public:
2325
2328
2331
2333 return getLocalData()->UnderlyingTInfo;
2334 }
2335
2337 getLocalData()->UnderlyingTInfo = TInfo;
2338 }
2339
2341 return SourceRange(getKWLoc(), getRParenLoc());
2342 }
2343
2346 }
2347
2349 setLParenLoc(Range.getBegin());
2350 setRParenLoc(Range.getEnd());
2351 }
2352
2354};
2355
2357 : public InheritingConcreteTypeLoc<TypeSpecTypeLoc, DeducedTypeLoc,
2358 DeducedType> {};
2359
2361 // For decltype(auto).
2363
2365};
2366
2368 : public ConcreteTypeLoc<DeducedTypeLoc,
2369 AutoTypeLoc,
2370 AutoType,
2371 AutoTypeLocInfo> {
2372public:
2374 return getTypePtr()->getKeyword();
2375 }
2376
2377 bool isDecltypeAuto() const { return getTypePtr()->isDecltypeAuto(); }
2380
2381 bool isConstrained() const {
2382 return getTypePtr()->isConstrained();
2383 }
2384
2386
2388
2389 // FIXME: Several of the following functions can be removed. Instead the
2390 // caller can directly work with the ConceptReference.
2392 if (const auto *CR = getConceptReference())
2393 return CR->getNestedNameSpecifierLoc();
2394 return NestedNameSpecifierLoc();
2395 }
2396
2398 if (const auto *CR = getConceptReference())
2399 return CR->getTemplateKWLoc();
2400 return SourceLocation();
2401 }
2402
2404 if (const auto *CR = getConceptReference())
2405 return CR->getConceptNameLoc();
2406 return SourceLocation();
2407 }
2408
2410 if (const auto *CR = getConceptReference())
2411 return CR->getFoundDecl();
2412 return nullptr;
2413 }
2414
2416 if (const auto *CR = getConceptReference())
2417 return CR->getNamedConcept();
2418 return nullptr;
2419 }
2420
2423 }
2424
2426 return (getConceptReference() &&
2427 getConceptReference()->getTemplateArgsAsWritten() &&
2429 ->getTemplateArgsAsWritten()
2430 ->getLAngleLoc()
2431 .isValid());
2432 }
2433
2435 if (const auto *CR = getConceptReference())
2436 if (const auto *TAAW = CR->getTemplateArgsAsWritten())
2437 return TAAW->getLAngleLoc();
2438 return SourceLocation();
2439 }
2440
2442 if (const auto *CR = getConceptReference())
2443 if (const auto *TAAW = CR->getTemplateArgsAsWritten())
2444 return TAAW->getRAngleLoc();
2445 return SourceLocation();
2446 }
2447
2448 unsigned getNumArgs() const {
2449 return getTypePtr()->getTypeConstraintArguments().size();
2450 }
2451
2452 TemplateArgumentLoc getArgLoc(unsigned i) const {
2453 const auto *CR = getConceptReference();
2454 assert(CR && "No ConceptReference");
2455 return CR->getTemplateArgsAsWritten()->getTemplateArgs()[i];
2456 }
2457
2459 return {isConstrained()
2463 : getConceptNameLoc()))
2464 : getNameLoc(),
2466 }
2467
2469 unsigned size = getFullDataSize();
2470 assert(size == Loc.getFullDataSize());
2471 memcpy(Data, Loc.Data, size);
2472 }
2473
2475};
2476
2479 /// Data associated with the nested-name-specifier location.
2481};
2482
2484 : public ConcreteTypeLoc<DeducedTypeLoc,
2485 DeducedTemplateSpecializationTypeLoc,
2486 DeducedTemplateSpecializationType,
2487 DeducedTemplateSpecializationLocInfo> {
2488public:
2490 return getLocalData()->ElaboratedKWLoc;
2491 }
2492
2495 }
2496
2498
2500
2502 void *Data = getLocalData()->QualifierData;
2503 if (!Data)
2504 return NestedNameSpecifierLoc();
2505 NestedNameSpecifier Qualifier =
2507 assert(Qualifier && "missing qualification");
2508 return NestedNameSpecifierLoc(Qualifier, Data);
2509 }
2510
2512 if (!QualifierLoc) {
2513 // Even if we have a nested-name-specifier in the dependent
2514 // template specialization type, we won't record the nested-name-specifier
2515 // location information when this type-source location information is
2516 // part of a nested-name-specifier.
2517 getLocalData()->QualifierData = nullptr;
2518 return;
2519 }
2520
2521 assert(QualifierLoc.getNestedNameSpecifier() ==
2522 getTypePtr()->getTemplateName().getQualifier() &&
2523 "Inconsistent nested-name-specifier pointer");
2524 getLocalData()->QualifierData = QualifierLoc.getOpaqueData();
2525 }
2526
2529 if (BeginLoc.isInvalid())
2530 BeginLoc = getQualifierLoc().getBeginLoc();
2531 if (BeginLoc.isInvalid())
2532 BeginLoc = getNameLoc();
2533 return {BeginLoc, getNameLoc()};
2534 }
2535
2537};
2538
2541
2542 /// Data associated with the nested-name-specifier location.
2544};
2545
2546// This is exactly the structure of an ElaboratedTypeLoc whose inner
2547// type is some sort of TypeDeclTypeLoc.
2550};
2551
2552class DependentNameTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
2553 DependentNameTypeLoc,
2554 DependentNameType,
2555 DependentNameLocInfo> {
2556public:
2558 return this->getLocalData()->ElaboratedKWLoc;
2559 }
2560
2562 this->getLocalData()->ElaboratedKWLoc = Loc;
2563 }
2564
2566 return NestedNameSpecifierLoc(getTypePtr()->getQualifier(),
2567 getLocalData()->QualifierData);
2568 }
2569
2571 assert(QualifierLoc.getNestedNameSpecifier()
2572 == getTypePtr()->getQualifier() &&
2573 "Inconsistent nested-name-specifier pointer");
2574 getLocalData()->QualifierData = QualifierLoc.getOpaqueData();
2575 }
2576
2578 return this->getLocalData()->NameLoc;
2579 }
2580
2582 this->getLocalData()->NameLoc = Loc;
2583 }
2584
2586 if (getElaboratedKeywordLoc().isValid())
2588 else
2590 }
2591
2593 unsigned size = getFullDataSize();
2594 assert(size == Loc.getFullDataSize());
2595 memcpy(Data, Loc.Data, size);
2596 }
2597
2599};
2600
2605 // followed by a TemplateArgumentLocInfo[]
2606};
2607
2609 public ConcreteTypeLoc<UnqualTypeLoc,
2610 DependentTemplateSpecializationTypeLoc,
2611 DependentTemplateSpecializationType,
2612 DependentTemplateSpecializationLocInfo> {
2613public:
2615 return this->getLocalData()->ElaboratedKWLoc;
2616 }
2617
2619 this->getLocalData()->ElaboratedKWLoc = Loc;
2620 }
2621
2623 if (!getLocalData()->QualifierData)
2624 return NestedNameSpecifierLoc();
2625
2627 getTypePtr()->getDependentTemplateName().getQualifier(),
2628 getLocalData()->QualifierData);
2629 }
2630
2632 if (!QualifierLoc) {
2633 // Even if we have a nested-name-specifier in the dependent
2634 // template specialization type, we won't record the nested-name-specifier
2635 // location information when this type-source location information is
2636 // part of a nested-name-specifier.
2637 getLocalData()->QualifierData = nullptr;
2638 return;
2639 }
2640
2641 assert(QualifierLoc.getNestedNameSpecifier() ==
2642 getTypePtr()->getDependentTemplateName().getQualifier() &&
2643 "Inconsistent nested-name-specifier pointer");
2644 getLocalData()->QualifierData = QualifierLoc.getOpaqueData();
2645 }
2646
2648 return getLocalData()->TemplateKWLoc;
2649 }
2650
2653 }
2654
2656 return this->getLocalData()->NameLoc;
2657 }
2658
2660 this->getLocalData()->NameLoc = Loc;
2661 }
2662
2664 return this->getLocalData()->LAngleLoc;
2665 }
2666
2668 this->getLocalData()->LAngleLoc = Loc;
2669 }
2670
2672 return this->getLocalData()->RAngleLoc;
2673 }
2674
2676 this->getLocalData()->RAngleLoc = Loc;
2677 }
2678
2679 unsigned getNumArgs() const {
2680 return getTypePtr()->template_arguments().size();
2681 }
2682
2684 getArgInfos()[i] = AI;
2685 }
2686
2688 return getArgInfos()[i];
2689 }
2690
2691 TemplateArgumentLoc getArgLoc(unsigned i) const {
2692 return TemplateArgumentLoc(getTypePtr()->template_arguments()[i],
2693 getArgLocInfo(i));
2694 }
2695
2697 if (getElaboratedKeywordLoc().isValid())
2699 else if (getQualifierLoc())
2701 else if (getTemplateKeywordLoc().isValid())
2703 else
2705 }
2706
2708 unsigned size = getFullDataSize();
2709 assert(size == Loc.getFullDataSize());
2710 memcpy(Data, Loc.Data, size);
2711 }
2712
2714
2715 unsigned getExtraLocalDataSize() const {
2716 return getNumArgs() * sizeof(TemplateArgumentLocInfo);
2717 }
2718
2720 return alignof(TemplateArgumentLocInfo);
2721 }
2722
2723private:
2724 TemplateArgumentLocInfo *getArgInfos() const {
2725 return static_cast<TemplateArgumentLocInfo*>(getExtraLocalData());
2726 }
2727};
2728
2731};
2732
2734 : public ConcreteTypeLoc<UnqualTypeLoc, PackExpansionTypeLoc,
2735 PackExpansionType, PackExpansionTypeLocInfo> {
2736public:
2738 return this->getLocalData()->EllipsisLoc;
2739 }
2740
2742 this->getLocalData()->EllipsisLoc = Loc;
2743 }
2744
2747 }
2748
2751 }
2752
2754 return getInnerTypeLoc();
2755 }
2756
2758 return this->getTypePtr()->getPattern();
2759 }
2760};
2761
2764};
2765
2766class AtomicTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, AtomicTypeLoc,
2767 AtomicType, AtomicTypeLocInfo> {
2768public:
2770 return this->getInnerTypeLoc();
2771 }
2772
2774 return SourceRange(getKWLoc(), getRParenLoc());
2775 }
2776
2778 return this->getLocalData()->KWLoc;
2779 }
2780
2782 this->getLocalData()->KWLoc = Loc;
2783 }
2784
2786 return this->getLocalData()->LParenLoc;
2787 }
2788
2790 this->getLocalData()->LParenLoc = Loc;
2791 }
2792
2794 return this->getLocalData()->RParenLoc;
2795 }
2796
2798 this->getLocalData()->RParenLoc = Loc;
2799 }
2800
2803 }
2804
2806 setLParenLoc(Range.getBegin());
2807 setRParenLoc(Range.getEnd());
2808 }
2809
2811 setKWLoc(Loc);
2814 }
2815
2817 return this->getTypePtr()->getValueType();
2818 }
2819};
2820
2823};
2824
2825class PipeTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, PipeTypeLoc, PipeType,
2826 PipeTypeLocInfo> {
2827public:
2828 TypeLoc getValueLoc() const { return this->getInnerTypeLoc(); }
2829
2831
2832 SourceLocation getKWLoc() const { return this->getLocalData()->KWLoc; }
2834
2836 setKWLoc(Loc);
2837 }
2838
2839 QualType getInnerType() const { return this->getTypePtr()->getElementType(); }
2840};
2841
2842template <typename T>
2844 TypeLoc Cur = *this;
2845 while (!T::isKind(Cur)) {
2846 if (auto PTL = Cur.getAs<ParenTypeLoc>())
2847 Cur = PTL.getInnerLoc();
2848 else if (auto ATL = Cur.getAs<AttributedTypeLoc>())
2849 Cur = ATL.getModifiedLoc();
2850 else if (auto ATL = Cur.getAs<BTFTagAttributedTypeLoc>())
2851 Cur = ATL.getWrappedLoc();
2852 else if (auto ATL = Cur.getAs<HLSLAttributedResourceTypeLoc>())
2853 Cur = ATL.getWrappedLoc();
2854 else if (auto ATL = Cur.getAs<AdjustedTypeLoc>())
2855 Cur = ATL.getOriginalLoc();
2856 else if (auto MQL = Cur.getAs<MacroQualifiedTypeLoc>())
2857 Cur = MQL.getInnerLoc();
2858 else
2859 break;
2860 }
2861 return Cur.getAs<T>();
2862}
2863class BitIntTypeLoc final
2864 : public InheritingConcreteTypeLoc<TypeSpecTypeLoc, BitIntTypeLoc,
2865 BitIntType> {};
2867 : public InheritingConcreteTypeLoc<TypeSpecTypeLoc, DependentBitIntTypeLoc,
2868 DependentBitIntType> {};
2869
2871 ObjCProtocolDecl *Protocol = nullptr;
2873
2874public:
2876 : Protocol(protocol), Loc(loc) {}
2877 ObjCProtocolDecl *getProtocol() const { return Protocol; }
2878 SourceLocation getLocation() const { return Loc; }
2879
2880 /// The source range is just the protocol name.
2881 SourceRange getSourceRange() const LLVM_READONLY {
2882 return SourceRange(Loc, Loc);
2883 }
2884};
2885
2886struct PredefinedSugarTypeLocInfo {}; // Nothing.
2887
2889 : public ConcreteTypeLoc<UnqualTypeLoc, PredefinedSugarTypeLoc,
2890 PredefinedSugarType, PredefinedSugarTypeLocInfo> {
2891public:
2893 SourceRange getLocalSourceRange() const { return {}; }
2894};
2895
2896} // namespace clang
2897
2898#endif // LLVM_CLANG_AST_TYPELOC_H
This file provides AST data structures related to concepts.
MatchType Type
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
SourceRange Range
Definition: SemaObjC.cpp:753
SourceLocation Loc
Definition: SemaObjC.cpp:754
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
__DEVICE__ void * memset(void *__a, int __b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:188
QualType getInnerType() const
Definition: TypeLoc.h:1436
unsigned getLocalDataSize() const
Definition: TypeLoc.h:1444
TypeLoc getOriginalLoc() const
Definition: TypeLoc.h:1428
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:1432
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1442
QualType getOriginalType() const
Definition: TypeBase.h:3520
Wrapper for source info for array parameter types.
Definition: TypeLoc.h:1813
Wrapper for source info for arrays.
Definition: TypeLoc.h:1757
SourceLocation getLBracketLoc() const
Definition: TypeLoc.h:1759
Expr * getSizeExpr() const
Definition: TypeLoc.h:1779
void setLBracketLoc(SourceLocation Loc)
Definition: TypeLoc.h:1763
TypeLoc getElementLoc() const
Definition: TypeLoc.h:1787
void setRBracketLoc(SourceLocation Loc)
Definition: TypeLoc.h:1771
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:1795
SourceLocation getRBracketLoc() const
Definition: TypeLoc.h:1767
SourceRange getBracketsRange() const
Definition: TypeLoc.h:1775
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1791
QualType getInnerType() const
Definition: TypeLoc.h:1801
void setSizeExpr(Expr *Size)
Definition: TypeLoc.h:1783
QualType getElementType() const
Definition: TypeBase.h:3750
SourceLocation getRParenLoc() const
Definition: TypeLoc.h:2793
QualType getInnerType() const
Definition: TypeLoc.h:2816
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2773
void setRParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:2797
SourceRange getParensRange() const
Definition: TypeLoc.h:2801
TypeLoc getValueLoc() const
Definition: TypeLoc.h:2769
void setLParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:2789
void setKWLoc(SourceLocation Loc)
Definition: TypeLoc.h:2781
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:2810
SourceLocation getKWLoc() const
Definition: TypeLoc.h:2777
SourceLocation getLParenLoc() const
Definition: TypeLoc.h:2785
void setParensRange(SourceRange Range)
Definition: TypeLoc.h:2805
QualType getValueType() const
Gets the type contained by this atomic type, i.e.
Definition: TypeBase.h:8142
Attr - This represents one attribute.
Definition: Attr.h:44
Type source information for an attributed type.
Definition: TypeLoc.h:1017
const Attr * getAttr() const
The type attribute.
Definition: TypeLoc.h:1040
QualType getInnerType() const
Definition: TypeLoc.h:1057
const T * getAttrAs()
Definition: TypeLoc.h:1047
TypeLoc getModifiedLoc() const
The modified type, which is generally canonically different from the attribute type.
Definition: TypeLoc.h:1031
TypeLoc getEquivalentTypeLoc() const
Definition: TypeLoc.h:1035
void initializeLocal(ASTContext &Context, SourceLocation loc)
Definition: TypeLoc.h:1053
SourceRange getLocalSourceRange() const
Definition: TypeLoc.cpp:629
void setAttr(const Attr *A)
Definition: TypeLoc.h:1043
attr::Kind getAttrKind() const
Definition: TypeLoc.h:1019
bool isQualifier() const
Definition: TypeLoc.h:1023
QualType getModifiedType() const
Definition: TypeBase.h:6615
Kind getAttrKind() const
Definition: TypeBase.h:6609
bool isQualifier() const
Does this attribute behave like a type qualifier?
Definition: Type.cpp:4396
bool hasExplicitTemplateArgs() const
Definition: TypeLoc.h:2425
SourceLocation getTemplateKWLoc() const
Definition: TypeLoc.h:2397
AutoTypeKeyword getAutoKeyword() const
Definition: TypeLoc.h:2373
const NestedNameSpecifierLoc getNestedNameSpecifierLoc() const
Definition: TypeLoc.h:2391
SourceLocation getRAngleLoc() const
Definition: TypeLoc.h:2441
SourceLocation getRParenLoc() const
Definition: TypeLoc.h:2378
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.cpp:851
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2458
void copy(AutoTypeLoc Loc)
Definition: TypeLoc.h:2468
SourceLocation getLAngleLoc() const
Definition: TypeLoc.h:2434
void setConceptReference(ConceptReference *CR)
Definition: TypeLoc.h:2385
SourceLocation getConceptNameLoc() const
Definition: TypeLoc.h:2403
NamedDecl * getFoundDecl() const
Definition: TypeLoc.h:2409
TemplateArgumentLoc getArgLoc(unsigned i) const
Definition: TypeLoc.h:2452
bool isDecltypeAuto() const
Definition: TypeLoc.h:2377
bool isConstrained() const
Definition: TypeLoc.h:2381
unsigned getNumArgs() const
Definition: TypeLoc.h:2448
TemplateDecl * getNamedConcept() const
Definition: TypeLoc.h:2415
ConceptReference * getConceptReference() const
Definition: TypeLoc.h:2387
DeclarationNameInfo getConceptNameInfo() const
Definition: TypeLoc.h:2421
void setRParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:2379
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
Definition: TypeBase.h:7190
bool isDecltypeAuto() const
Definition: TypeBase.h:7203
AutoTypeKeyword getKeyword() const
Definition: TypeBase.h:7211
bool isConstrained() const
Definition: TypeBase.h:7199
Type source information for an btf_tag attributed type.
Definition: TypeLoc.h:1067
QualType getInnerType() const
Definition: TypeLoc.h:1082
TypeLoc getWrappedLoc() const
Definition: TypeLoc.h:1069
void initializeLocal(ASTContext &Context, SourceLocation loc)
Definition: TypeLoc.h:1080
const BTFTypeTagAttr * getAttr() const
The btf_type_tag attribute.
Definition: TypeLoc.h:1072
SourceRange getLocalSourceRange() const
Definition: TypeLoc.cpp:646
const BTFTypeTagAttr * getAttr() const
Definition: TypeBase.h:6689
QualType getWrappedType() const
Definition: TypeBase.h:6688
Wrapper for source info for block pointers.
Definition: TypeLoc.h:1506
SourceLocation getCaretLoc() const
Definition: TypeLoc.h:1508
void setCaretLoc(SourceLocation Loc)
Definition: TypeLoc.h:1512
QualType getInnerType() const
Definition: TypeLoc.h:1321
unsigned getLocalDataSize() const
Definition: TypeLoc.h:1326
TypeLoc getInnerLoc() const
Definition: TypeLoc.h:1320
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:1322
QualType desugar() const
Definition: TypeBase.h:3416
Wrapper for source info for builtin types.
Definition: TypeLoc.h:582
SourceLocation getBuiltinLoc() const
Definition: TypeLoc.h:584
TypeSpecifierType getWrittenTypeSpec() const
Definition: TypeLoc.cpp:322
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:685
TypeSpecifierWidth getWrittenWidthSpec() const
Definition: TypeLoc.h:646
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:626
void setWrittenTypeSpec(TypeSpecifierType written)
Definition: TypeLoc.h:668
const WrittenBuiltinSpecs & getWrittenBuiltinSpecs() const
Definition: TypeLoc.h:607
bool needsExtraLocalData() const
Definition: TypeLoc.h:611
bool hasWrittenWidthSpec() const
Definition: TypeLoc.h:653
void setModeAttr(bool written)
Definition: TypeLoc.h:680
void setBuiltinLoc(SourceLocation Loc)
Definition: TypeLoc.h:588
void setWrittenWidthSpec(TypeSpecifierWidth written)
Definition: TypeLoc.h:657
SourceLocation getNameLoc() const
Definition: TypeLoc.h:602
unsigned getExtraLocalDataAlignment() const
Definition: TypeLoc.h:622
WrittenBuiltinSpecs & getWrittenBuiltinSpecs()
Definition: TypeLoc.h:604
void setWrittenSignSpec(TypeSpecifierSign written)
Definition: TypeLoc.h:641
bool hasWrittenSignSpec() const
Definition: TypeLoc.h:637
bool hasModeAttr() const
Definition: TypeLoc.h:673
unsigned getExtraLocalDataSize() const
Definition: TypeLoc.h:618
bool hasWrittenTypeSpec() const
Definition: TypeLoc.h:664
TypeSpecifierSign getWrittenSignSpec() const
Definition: TypeLoc.h:630
void expandBuiltinRange(SourceRange Range)
Definition: TypeLoc.h:592
Kind getKind() const
Definition: TypeBase.h:3230
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
A reference to a concept and its template args, as it appears in the code.
Definition: ASTConcept.h:126
const DeclarationNameInfo & getConceptNameInfo() const
Definition: ASTConcept.h:170
A metaprogramming base class for TypeLoc classes which correspond to a particular Type subclass.
Definition: TypeLoc.h:389
const TypeClass * getTypePtr() const
Definition: TypeLoc.h:438
friend class TypeLoc
Definition: TypeLoc.h:390
TypeLoc getInnerTypeLoc() const
Definition: TypeLoc.h:475
unsigned getExtraLocalDataAlignment() const
Definition: TypeLoc.h:447
HasNoInnerType getInnerType() const
Definition: TypeLoc.h:473
void * getExtraLocalData() const
Gets a pointer past the Info structure; useful for classes with local data that can't be captured in ...
Definition: TypeLoc.h:458
LocalData * getLocalData() const
Definition: TypeLoc.h:451
unsigned getLocalDataAlignment() const
Definition: TypeLoc.h:406
void * getNonLocalData() const
Definition: TypeLoc.h:465
TypeLoc getNextTypeLoc() const
Definition: TypeLoc.h:434
unsigned getExtraLocalDataSize() const
Definition: TypeLoc.h:443
void copyLocal(Derived other)
Definition: TypeLoc.h:420
unsigned getLocalDataSize() const
Definition: TypeLoc.h:411
Expr * getCountExpr() const
Definition: TypeLoc.h:1334
SourceRange getLocalSourceRange() const
Definition: TypeLoc.cpp:642
bool isCountInBytes() const
Definition: TypeBase.h:3481
Expr * getCountExpr() const
Definition: TypeBase.h:3480
Wrapper for source info for pointers decayed from arrays and functions.
Definition: TypeLoc.h:1454
SourceLocation getDecltypeLoc() const
Definition: TypeLoc.h:2267
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:2277
Expr * getUnderlyingExpr() const
Definition: TypeLoc.h:2265
SourceLocation getRParenLoc() const
Definition: TypeLoc.h:2270
void setRParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:2271
void setDecltypeLoc(SourceLocation Loc)
Definition: TypeLoc.h:2268
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2273
Expr * getUnderlyingExpr() const
Definition: TypeBase.h:6280
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
Definition: TypeLoc.h:2511
void setElaboratedKeywordLoc(SourceLocation Loc)
Definition: TypeLoc.h:2493
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.cpp:861
SourceLocation getElaboratedKeywordLoc() const
Definition: TypeLoc.h:2489
SourceLocation getTemplateNameLoc() const
Definition: TypeLoc.h:2497
void setTemplateNameLoc(SourceLocation Loc)
Definition: TypeLoc.h:2499
NestedNameSpecifierLoc getQualifierLoc() const
Definition: TypeLoc.h:2501
TemplateName getTemplateName() const
Retrieve the name of the template that we are deducing.
Definition: TypeBase.h:7248
void setAttrNameLoc(SourceLocation loc)
Definition: TypeLoc.h:1957
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1982
void setAttrOperandParensRange(SourceRange range)
Definition: TypeLoc.h:1978
QualType getInnerType() const
Returns the type before the address space attribute application area.
Definition: TypeLoc.h:1992
Expr * getAttrExprOperand() const
The attribute's expression operand, if it has one.
Definition: TypeLoc.h:1964
void initializeLocal(ASTContext &Context, SourceLocation loc)
Definition: TypeLoc.h:2000
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
Definition: TypeLoc.h:1975
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
Definition: TypeLoc.h:1954
QualType getPointeeType() const
Definition: TypeBase.h:4089
void copy(DependentNameTypeLoc Loc)
Definition: TypeLoc.h:2592
NestedNameSpecifierLoc getQualifierLoc() const
Definition: TypeLoc.h:2565
SourceLocation getNameLoc() const
Definition: TypeLoc.h:2577
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.cpp:685
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2585
SourceLocation getElaboratedKeywordLoc() const
Definition: TypeLoc.h:2557
void setNameLoc(SourceLocation Loc)
Definition: TypeLoc.h:2581
void setElaboratedKeywordLoc(SourceLocation Loc)
Definition: TypeLoc.h:2561
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
Definition: TypeLoc.h:2570
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:1826
SourceLocation getNameLoc() const
Definition: TypeLoc.h:2074
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2078
void setNameLoc(SourceLocation Loc)
Definition: TypeLoc.h:2076
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:2082
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
Definition: TypeLoc.h:2631
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.cpp:694
SourceLocation getTemplateNameLoc() const
Definition: TypeLoc.h:2655
void setTemplateKeywordLoc(SourceLocation Loc)
Definition: TypeLoc.h:2651
void copy(DependentTemplateSpecializationTypeLoc Loc)
Definition: TypeLoc.h:2707
SourceLocation getTemplateKeywordLoc() const
Definition: TypeLoc.h:2647
void setElaboratedKeywordLoc(SourceLocation Loc)
Definition: TypeLoc.h:2618
void setRAngleLoc(SourceLocation Loc)
Definition: TypeLoc.h:2675
TemplateArgumentLoc getArgLoc(unsigned i) const
Definition: TypeLoc.h:2691
TemplateArgumentLocInfo getArgLocInfo(unsigned i) const
Definition: TypeLoc.h:2687
SourceLocation getElaboratedKeywordLoc() const
Definition: TypeLoc.h:2614
void setLAngleLoc(SourceLocation Loc)
Definition: TypeLoc.h:2667
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
Definition: TypeLoc.h:2683
void setTemplateNameLoc(SourceLocation Loc)
Definition: TypeLoc.h:2659
NestedNameSpecifierLoc getQualifierLoc() const
Definition: TypeLoc.h:2622
ArrayRef< TemplateArgument > template_arguments() const
Definition: TypeBase.h:7480
SourceLocation getNameLoc() const
Definition: TypeLoc.h:2046
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2050
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:2054
TypeLoc getElementLoc() const
Definition: TypeLoc.h:2058
void setNameLoc(SourceLocation Loc)
Definition: TypeLoc.h:2048
QualType getInnerType() const
Definition: TypeLoc.h:2060
QualType getElementType() const
Definition: TypeBase.h:4255
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:768
auto * getDecl() const
Definition: TypeLoc.h:747
void set(SourceLocation ElaboratedKeywordLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation NameLoc)
Definition: TypeLoc.h:749
SourceLocation getElaboratedKeywordLoc() const
Definition: TypeLoc.h:757
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:773
SourceLocation getNameLoc() const
Definition: TypeLoc.h:766
NestedNameSpecifierLoc getQualifierLoc() const
Definition: TypeLoc.h:761
Represents an enum.
Definition: Decl.h:4000
Wrapper for source info for enum types.
Definition: TypeLoc.h:870
EnumDecl * getOriginalDecl() const
Definition: TypeLoc.h:872
EnumDecl * getOriginalDecl() const
Definition: TypeBase.h:6529
This represents one expression.
Definition: Expr.h:112
Wrapper for source info for functions.
Definition: TypeLoc.h:1624
ParmVarDecl ** getParmArray() const
Definition: TypeLoc.h:1692
QualType getInnerType() const
Definition: TypeLoc.h:1733
unsigned getNumParams() const
Definition: TypeLoc.h:1696
ParmVarDecl * getParam(unsigned i) const
Definition: TypeLoc.h:1702
SourceLocation getLocalRangeEnd() const
Definition: TypeLoc.h:1648
void setLocalRangeBegin(SourceLocation L)
Definition: TypeLoc.h:1644
void setLParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:1660
SourceRange getExceptionSpecRange() const
Definition: TypeLoc.h:1676
void setParam(unsigned i, ParmVarDecl *VD)
Definition: TypeLoc.h:1703
ArrayRef< ParmVarDecl * > getParams() const
Definition: TypeLoc.h:1687
SourceRange getParensRange() const
Definition: TypeLoc.h:1672
void setRParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:1668
unsigned getExtraLocalDataAlignment() const
Definition: TypeLoc.h:1731
void setLocalRangeEnd(SourceLocation L)
Definition: TypeLoc.h:1652
unsigned getExtraLocalDataSize() const
Returns the size of the type source info data block that is specific to this type.
Definition: TypeLoc.h:1726
void setExceptionSpecRange(SourceRange R)
Definition: TypeLoc.h:1682
TypeLoc getReturnLoc() const
Definition: TypeLoc.h:1705
SourceLocation getLocalRangeBegin() const
Definition: TypeLoc.h:1640
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1709
SourceLocation getLParenLoc() const
Definition: TypeLoc.h:1656
SourceLocation getRParenLoc() const
Definition: TypeLoc.h:1664
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:1713
QualType getReturnType() const
Definition: TypeBase.h:4818
Type source information for HLSL attributed resource type.
Definition: TypeLoc.h:1094
void initializeLocal(ASTContext &Context, SourceLocation loc)
Definition: TypeLoc.h:1107
TypeSourceInfo * getContainedTypeSourceInfo() const
Definition: TypeLoc.h:1098
void setContainedTypeSourceInfo(TypeSourceInfo *TSI) const
Definition: TypeLoc.h:1101
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1106
void setSourceRange(const SourceRange &R)
Definition: TypeLoc.h:1105
QualType getWrappedType() const
Definition: TypeBase.h:6751
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1127
void setSpirvTypeLoc(SourceLocation loc) const
Definition: TypeLoc.h:1125
SourceLocation getSpirvTypeLoc() const
Definition: TypeLoc.h:1124
void initializeLocal(ASTContext &Context, SourceLocation loc)
Definition: TypeLoc.h:1130
One of these records is kept for each identifier that is lexed.
A metaprogramming class designed for concrete subtypes of abstract types where all subtypes share equ...
Definition: TypeLoc.h:515
const TypeClass * getTypePtr() const
Definition: TypeLoc.h:531
Wrapper for source info for injected class names of class templates.
Definition: TypeLoc.h:879
CXXRecordDecl * getOriginalDecl() const
Definition: TypeLoc.h:881
CXXRecordDecl * getOriginalDecl() const
Definition: TypeBase.h:6564
void setAmpLoc(SourceLocation Loc)
Definition: TypeLoc.h:1594
SourceLocation getAmpLoc() const
Definition: TypeLoc.h:1590
const IdentifierInfo * getMacroIdentifier() const
Definition: TypeLoc.h:1355
SourceLocation getExpansionLoc() const
Definition: TypeLoc.h:1359
TypeLoc getInnerLoc() const
Definition: TypeLoc.h:1353
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:1349
void setExpansionLoc(SourceLocation Loc)
Definition: TypeLoc.h:1363
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1369
QualType getInnerType() const
Definition: TypeLoc.h:1367
QualType getUnderlyingType() const
Definition: TypeBase.h:6177
const IdentifierInfo * getMacroIdentifier() const
Definition: TypeBase.h:6176
Expr * getAttrColumnOperand() const
The attribute's column operand, if it has one.
Definition: TypeLoc.h:2116
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
Definition: TypeLoc.h:2123
void setAttrRowOperand(Expr *e)
Definition: TypeLoc.h:2111
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2130
void setAttrColumnOperand(Expr *e)
Definition: TypeLoc.h:2117
void setAttrOperandParensRange(SourceRange range)
Definition: TypeLoc.h:2126
void setAttrNameLoc(SourceLocation loc)
Definition: TypeLoc.h:2105
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
Definition: TypeLoc.h:2104
void initializeLocal(ASTContext &Context, SourceLocation loc)
Definition: TypeLoc.h:2136
Expr * getAttrRowOperand() const
The attribute's row operand, if it has one.
Definition: TypeLoc.h:2110
Wrapper for source info for member pointers.
Definition: TypeLoc.h:1524
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:1546
void setStarLoc(SourceLocation Loc)
Definition: TypeLoc.h:1530
NestedNameSpecifierLoc getQualifierLoc() const
Definition: TypeLoc.h:1534
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1556
SourceLocation getStarLoc() const
Definition: TypeLoc.h:1526
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
Definition: TypeLoc.h:1539
This represents a decl that may have a name.
Definition: Decl.h:273
Class that aids in the construction of nested-name-specifiers along with source-location information ...
A C++ nested-name-specifier augmented with source location information.
NestedNameSpecifier getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
void * getOpaqueData() const
Retrieve the opaque pointer that refers to source-location data.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Represents an ObjC class declaration.
Definition: DeclObjC.h:1154
Wrapper for source info for ObjC interfaces.
Definition: TypeLoc.h:1283
void setNameLoc(SourceLocation Loc)
Definition: TypeLoc.h:1293
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1297
void setNameEndLoc(SourceLocation Loc)
Definition: TypeLoc.h:1305
ObjCInterfaceDecl * getIFaceDecl() const
Definition: TypeLoc.h:1285
SourceLocation getNameEndLoc() const
Definition: TypeLoc.h:1301
SourceLocation getNameLoc() const
Definition: TypeLoc.h:1289
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:1309
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition: Type.cpp:951
Wraps an ObjCPointerType with source location information.
Definition: TypeLoc.h:1566
SourceLocation getStarLoc() const
Definition: TypeLoc.h:1568
void setStarLoc(SourceLocation Loc)
Definition: TypeLoc.h:1572
unsigned getExtraLocalDataAlignment() const
Definition: TypeLoc.h:1263
void setTypeArgsRAngleLoc(SourceLocation Loc)
Definition: TypeLoc.h:1176
ObjCProtocolDecl * getProtocol(unsigned i) const
Definition: TypeLoc.h:1224
unsigned getExtraLocalDataSize() const
Definition: TypeLoc.h:1258
bool hasBaseTypeAsWritten() const
Definition: TypeLoc.h:1234
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.cpp:613
SourceLocation getTypeArgsLAngleLoc() const
Definition: TypeLoc.h:1164
unsigned getNumTypeArgs() const
Definition: TypeLoc.h:1180
ArrayRef< SourceLocation > getProtocolLocs() const
Definition: TypeLoc.h:1230
unsigned getNumProtocols() const
Definition: TypeLoc.h:1210
void setTypeArgsLAngleLoc(SourceLocation Loc)
Definition: TypeLoc.h:1168
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1246
TypeSourceInfo * getTypeArgTInfo(unsigned i) const
Definition: TypeLoc.h:1184
void setTypeArgTInfo(unsigned i, TypeSourceInfo *TInfo)
Definition: TypeLoc.h:1189
void setProtocolLAngleLoc(SourceLocation Loc)
Definition: TypeLoc.h:1198
void setProtocolRAngleLoc(SourceLocation Loc)
Definition: TypeLoc.h:1206
SourceLocation getProtocolRAngleLoc() const
Definition: TypeLoc.h:1202
SourceLocation getProtocolLoc(unsigned i) const
Definition: TypeLoc.h:1214
void setHasBaseTypeAsWritten(bool HasBaseType)
Definition: TypeLoc.h:1238
void setProtocolLoc(unsigned i, SourceLocation Loc)
Definition: TypeLoc.h:1219
TypeLoc getBaseLoc() const
Definition: TypeLoc.h:1242
QualType getInnerType() const
Definition: TypeLoc.h:1269
SourceLocation getProtocolLAngleLoc() const
Definition: TypeLoc.h:1194
SourceLocation getTypeArgsRAngleLoc() const
Definition: TypeLoc.h:1172
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
Definition: TypeBase.h:7817
QualType getBaseType() const
Gets the base type of this object type.
Definition: TypeBase.h:7769
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2084
SourceLocation getLocation() const
Definition: TypeLoc.h:2878
ObjCProtocolLoc(ObjCProtocolDecl *protocol, SourceLocation loc)
Definition: TypeLoc.h:2875
ObjCProtocolDecl * getProtocol() const
Definition: TypeLoc.h:2877
SourceRange getSourceRange() const LLVM_READONLY
The source range is just the protocol name.
Definition: TypeLoc.h:2881
unsigned getNumProtocols() const
Return the number of qualifying protocols in this type, or 0 if there are none.
Definition: TypeBase.h:7613
qual_iterator qual_begin() const
Definition: TypeBase.h:7606
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:578
ProtocolLAngleLoc, ProtocolRAngleLoc, and the source locations for protocol qualifiers are stored aft...
Definition: TypeLoc.h:904
unsigned getExtraLocalDataAlignment() const
Definition: TypeLoc.h:973
ObjCTypeParamDecl * getDecl() const
Definition: TypeLoc.h:911
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:977
unsigned getNumProtocols() const
Definition: TypeLoc.h:941
SourceLocation getNameLoc() const
Definition: TypeLoc.h:913
ObjCProtocolDecl * getProtocol(unsigned i) const
Definition: TypeLoc.h:955
SourceLocation getProtocolLoc(unsigned i) const
Definition: TypeLoc.h:945
ArrayRef< SourceLocation > getProtocolLocs() const
Definition: TypeLoc.h:960
void setProtocolLoc(unsigned i, SourceLocation Loc)
Definition: TypeLoc.h:950
void setProtocolLAngleLoc(SourceLocation Loc)
Definition: TypeLoc.h:927
unsigned getExtraLocalDataSize() const
Definition: TypeLoc.h:966
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.cpp:602
SourceLocation getProtocolLAngleLoc() const
Definition: TypeLoc.h:921
void setProtocolRAngleLoc(SourceLocation Loc)
Definition: TypeLoc.h:937
void setNameLoc(SourceLocation Loc)
Definition: TypeLoc.h:917
SourceLocation getProtocolRAngleLoc() const
Definition: TypeLoc.h:931
ObjCTypeParamDecl * getDecl() const
Definition: TypeBase.h:7675
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2745
void setEllipsisLoc(SourceLocation Loc)
Definition: TypeLoc.h:2741
SourceLocation getEllipsisLoc() const
Definition: TypeLoc.h:2737
TypeLoc getPatternLoc() const
Definition: TypeLoc.h:2753
QualType getInnerType() const
Definition: TypeLoc.h:2757
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:2749
QualType getPattern() const
Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated w...
Definition: TypeBase.h:7545
SourceLocation getEllipsisLoc() const
Definition: TypeLoc.h:2295
Expr * getIndexExpr() const
Definition: TypeLoc.h:2292
TypeLoc getPatternLoc() const
Definition: TypeLoc.h:2302
QualType getPattern() const
Definition: TypeLoc.h:2293
QualType getInnerType() const
Definition: TypeLoc.h:2304
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2306
void setEllipsisLoc(SourceLocation Loc)
Definition: TypeLoc.h:2296
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:2298
QualType getPattern() const
Definition: TypeBase.h:6331
Expr * getIndexExpr() const
Definition: TypeBase.h:6330
void setRParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:1395
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:1403
SourceLocation getRParenLoc() const
Definition: TypeLoc.h:1387
QualType getInnerType() const
Definition: TypeLoc.h:1412
SourceLocation getLParenLoc() const
Definition: TypeLoc.h:1383
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1399
TypeLoc getInnerLoc() const
Definition: TypeLoc.h:1408
void setLParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:1391
QualType getInnerType() const
Definition: TypeBase.h:3329
Represents a parameter to a function.
Definition: Decl.h:1789
TypeLoc getValueLoc() const
Definition: TypeLoc.h:2828
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:2835
QualType getInnerType() const
Definition: TypeLoc.h:2839
void setKWLoc(SourceLocation Loc)
Definition: TypeLoc.h:2833
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2830
SourceLocation getKWLoc() const
Definition: TypeLoc.h:2832
QualType getElementType() const
Definition: TypeBase.h:8172
A base class for.
Definition: TypeLoc.h:1464
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:1482
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1478
void setSigilLoc(SourceLocation Loc)
Definition: TypeLoc.h:1470
QualType getInnerType() const
Definition: TypeLoc.h:1486
TypeLoc getPointeeLoc() const
Definition: TypeLoc.h:1474
SourceLocation getSigilLoc() const
Definition: TypeLoc.h:1466
Wrapper for source info for pointers.
Definition: TypeLoc.h:1493
SourceLocation getStarLoc() const
Definition: TypeLoc.h:1495
void setStarLoc(SourceLocation Loc)
Definition: TypeLoc.h:1499
void initializeLocal(ASTContext &Context, SourceLocation loc)
Definition: TypeLoc.h:2892
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2893
A (possibly-)qualified type.
Definition: TypeBase.h:937
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
Definition: TypeBase.h:1064
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Definition: TypeBase.h:8343
static QualType getFromOpaquePtr(const void *Ptr)
Definition: TypeBase.h:986
Wrapper of type source information for a type with non-trivial direct qualifiers.
Definition: TypeLoc.h:305
TypeLoc getNextTypeLoc() const
Definition: TypeLoc.h:327
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Initializes the local data of this type source info block to provide no information.
Definition: TypeLoc.h:319
unsigned getLocalDataSize() const
Returns the size of the type source info data block that is specific to this type.
Definition: TypeLoc.h:333
unsigned getLocalDataAlignment() const
Returns the alignment of the type source info data block that is specific to this type.
Definition: TypeLoc.h:341
void copyLocal(TypeLoc other)
Definition: TypeLoc.h:323
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:307
UnqualTypeLoc getUnqualifiedLoc() const
Definition: TypeLoc.h:309
void setAmpAmpLoc(SourceLocation Loc)
Definition: TypeLoc.h:1608
SourceLocation getAmpAmpLoc() const
Definition: TypeLoc.h:1604
Represents a struct/union/class.
Definition: Decl.h:4305
Wrapper for source info for record types.
Definition: TypeLoc.h:860
RecordDecl * getOriginalDecl() const
Definition: TypeLoc.h:862
RecordDecl * getOriginalDecl() const
Definition: TypeBase.h:6509
QualType getInnerType() const
Definition: TypeLoc.h:1580
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
void setBegin(SourceLocation b)
SourceLocation getEnd() const
SourceLocation getBegin() const
void setEnd(SourceLocation e)
Wrapper for substituted template type parameters.
Definition: TypeLoc.h:1007
Abstract type representing delayed type pack expansions.
Definition: TypeLoc.h:995
Wrapper for substituted template type parameters.
Definition: TypeLoc.h:1001
Wrapper for substituted template type parameters.
Definition: TypeLoc.h:989
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3710
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:831
SourceLocation getNameLoc() const
Definition: TypeLoc.h:827
SourceLocation getElaboratedKeywordLoc() const
Definition: TypeLoc.h:806
NestedNameSpecifierLoc getQualifierLoc() const
Definition: TypeLoc.h:814
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:841
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
Definition: TypeLoc.h:821
void setNameLoc(SourceLocation Loc)
Definition: TypeLoc.h:829
void setElaboratedKeywordLoc(SourceLocation Loc)
Definition: TypeLoc.h:810
TagDecl * getOriginalDecl() const
Definition: TypeLoc.h:801
bool isDefinition() const
True if the tag was defined in this type specifier.
Definition: TypeLoc.cpp:305
NestedNameSpecifier getQualifier() const
Definition: Type.cpp:4316
TagDecl * getOriginalDecl() const
Definition: TypeBase.h:6441
A convenient class for passing around template argument information.
Definition: TemplateBase.h:634
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:528
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:396
NestedNameSpecifier getQualifier() const
Definition: TemplateName.h:346
static void initializeArgLocs(ASTContext &Context, ArrayRef< TemplateArgument > Args, TemplateArgumentLocInfo *ArgInfos, SourceLocation Loc)
Definition: TypeLoc.cpp:777
SourceLocation getLAngleLoc() const
Definition: TypeLoc.h:1887
TemplateArgumentLoc getArgLoc(unsigned i) const
Definition: TypeLoc.h:1897
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:1916
SourceLocation getRAngleLoc() const
Definition: TypeLoc.h:1902
MutableArrayRef< TemplateArgumentLocInfo > getArgLocInfos()
Definition: TypeLoc.h:1893
void set(SourceLocation ElaboratedKeywordLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKeywordLoc, SourceLocation NameLoc, SourceLocation LAngleLoc, SourceLocation RAngleLoc)
Definition: TypeLoc.cpp:707
SourceLocation getTemplateNameLoc() const
Definition: TypeLoc.h:1885
void copy(TemplateSpecializationTypeLoc Loc)
Definition: TypeLoc.h:1905
unsigned getExtraLocalDataAlignment() const
Definition: TypeLoc.h:1929
SourceLocation getTemplateKeywordLoc() const
Definition: TypeLoc.h:1881
NestedNameSpecifierLoc getQualifierLoc() const
Definition: TypeLoc.h:1871
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.cpp:751
SourceLocation getElaboratedKeywordLoc() const
Definition: TypeLoc.h:1867
unsigned getExtraLocalDataSize() const
Definition: TypeLoc.h:1925
ArrayRef< TemplateArgument > template_arguments() const
Definition: TypeBase.h:7357
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: TypeBase.h:7355
Declaration of a template type parameter.
Wrapper for template type parameters.
Definition: TypeLoc.h:890
TemplateTypeParmDecl * getDecl() const
Definition: TypeLoc.h:892
TemplateTypeParmDecl * getDecl() const
Definition: TypeBase.h:6937
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:59
SourceLocation findNullabilityLoc() const
Find the location of the nullability specifier (__nonnull, __nullable, or __null_unspecifier),...
Definition: TypeLoc.cpp:442
TypeLoc()=default
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
Definition: TypeLoc.h:354
static unsigned getLocalAlignmentForType(QualType Ty)
Returns the alignment of type source info data block for the given type.
Definition: TypeLoc.cpp:75
TypeLoc findExplicitQualifierLoc() const
Find a type with the location of an explicit type qualifier.
Definition: TypeLoc.cpp:453
QualType getType() const
Get the type for which this source info wrapper provides information.
Definition: TypeLoc.h:133
TypeLoc getNextTypeLoc() const
Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the TypeLoc is a PointerLoc and next Typ...
Definition: TypeLoc.h:171
void dump() const
Definition: ASTDumper.cpp:207
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
Definition: TypeLoc.h:89
NestedNameSpecifierLoc getPrefix() const
If this type represents a qualified-id, this returns it's nested name specifier.
Definition: TypeLoc.cpp:474
friend bool operator==(const TypeLoc &LHS, const TypeLoc &RHS)
Definition: TypeLoc.h:239
TypeLoc IgnoreParens() const
Definition: TypeLoc.h:1417
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type.
Definition: TypeLoc.h:78
TypeLoc(QualType ty, void *opaqueData)
Definition: TypeLoc.h:68
void * Data
Definition: TypeLoc.h:64
SourceLocation getNonElaboratedBeginLoc() const
This returns the position of the type after any elaboration, such as the 'struct' keyword.
Definition: TypeLoc.cpp:539
void initializeFullCopy(TypeLoc Other)
Initializes this by copying its information from another TypeLoc of the same type.
Definition: TypeLoc.h:222
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Definition: TypeLoc.h:154
SourceRange getLocalSourceRange() const
Get the local source range.
Definition: TypeLoc.h:160
void initializeFullCopy(TypeLoc Other, unsigned Size)
Initializes this by copying its information from another TypeLoc of the same type.
Definition: TypeLoc.h:230
unsigned getFullDataSize() const
Returns the size of the type source info data block.
Definition: TypeLoc.h:165
AutoTypeLoc getContainedAutoTypeLoc() const
Get the typeloc of an AutoType whose type will be deduced for a variable with an initializer of this ...
Definition: TypeLoc.cpp:942
TypeLoc(const Type *ty, void *opaqueData)
Definition: TypeLoc.h:70
void * getOpaqueData() const
Get the pointer where source information is stored.
Definition: TypeLoc.h:143
TypeLocClass
The kinds of TypeLocs.
Definition: TypeLoc.h:108
const void * Ty
Definition: TypeLoc.h:63
SourceLocation getTemplateKeywordLoc() const
Get the SourceLocation of the template keyword (if any).
Definition: TypeLoc.cpp:949
void copy(TypeLoc other)
Copies the other type loc into this one.
Definition: TypeLoc.cpp:169
TypeLocClass getTypeLocClass() const
Definition: TypeLoc.h:116
static unsigned getFullDataSizeForType(QualType Ty)
Returns the size of type source info data block for the given type.
Definition: TypeLoc.cpp:95
void initialize(ASTContext &Context, SourceLocation Loc) const
Initializes this to state that every location in this type is the given location.
Definition: TypeLoc.h:216
bool isNull() const
Definition: TypeLoc.h:121
SourceLocation getEndLoc() const
Get the end source location.
Definition: TypeLoc.cpp:227
T getAsAdjusted() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
Definition: TypeLoc.h:2843
friend bool operator!=(const TypeLoc &LHS, const TypeLoc &RHS)
Definition: TypeLoc.h:243
SourceLocation getBeginLoc() const
Get the begin source location.
Definition: TypeLoc.cpp:193
SourceLocation getNonPrefixBeginLoc() const
This returns the position of the type after any elaboration, such as the 'struct' keyword,...
Definition: TypeLoc.cpp:499
const Type * getTypePtr() const
Definition: TypeLoc.h:137
SourceRange getLocalSourceRange() const
Definition: TypeLoc.cpp:313
Expr * getUnderlyingExpr() const
Definition: TypeLoc.h:2224
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.cpp:650
void setUnmodifiedTInfo(TypeSourceInfo *TI) const
Definition: TypeLoc.h:2245
TypeSourceInfo * getUnmodifiedTInfo() const
Definition: TypeLoc.h:2241
QualType getUnmodifiedType() const
Definition: TypeLoc.h:2237
A container of type source information.
Definition: TypeBase.h:8314
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
Definition: TypeLoc.h:272
A reasonable base class for TypeLocs that correspond to types that are written as a type-specifier.
Definition: TypeLoc.h:545
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:564
SourceLocation getNameLoc() const
Definition: TypeLoc.h:552
void setNameLoc(SourceLocation Loc)
Definition: TypeLoc.h:556
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:560
The base class of the type hierarchy.
Definition: TypeBase.h:1833
TypeClass getTypeClass() const
Definition: TypeBase.h:2403
Wrapper for source info for typedefs.
Definition: TypeLoc.h:782
void setParensRange(SourceRange range)
Definition: TypeLoc.h:2204
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2209
SourceLocation getLParenLoc() const
Definition: TypeLoc.h:2184
SourceLocation getRParenLoc() const
Definition: TypeLoc.h:2192
SourceRange getParensRange() const
Definition: TypeLoc.h:2200
void setLParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:2188
SourceLocation getTypeofLoc() const
Definition: TypeLoc.h:2176
void setTypeofLoc(SourceLocation Loc)
Definition: TypeLoc.h:2180
void setRParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:2196
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:2213
void setRParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:2330
void setParensRange(SourceRange Range)
Definition: TypeLoc.h:2348
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.cpp:658
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2340
void setKWLoc(SourceLocation Loc)
Definition: TypeLoc.h:2324
SourceLocation getKWLoc() const
Definition: TypeLoc.h:2323
SourceLocation getRParenLoc() const
Definition: TypeLoc.h:2329
TypeSourceInfo * getUnderlyingTInfo() const
Definition: TypeLoc.h:2332
SourceRange getParensRange() const
Definition: TypeLoc.h:2344
void setUnderlyingTInfo(TypeSourceInfo *TInfo)
Definition: TypeLoc.h:2336
void setLParenLoc(SourceLocation Loc)
Definition: TypeLoc.h:2327
SourceLocation getLParenLoc() const
Definition: TypeLoc.h:2326
Wrapper of type source information for a type with no direct qualifiers.
Definition: TypeLoc.h:279
TypeLocClass getTypeLocClass() const
Definition: TypeLoc.h:288
UnqualTypeLoc(const Type *Ty, void *Data)
Definition: TypeLoc.h:282
const Type * getTypePtr() const
Definition: TypeLoc.h:284
Wrapper for source info for unresolved typename using decls.
Definition: TypeLoc.h:787
Wrapper for source info for types used via transparent aliases.
Definition: TypeLoc.h:790
TypeLoc getElementLoc() const
Definition: TypeLoc.h:2035
void setNameLoc(SourceLocation Loc)
Definition: TypeLoc.h:2025
void initializeLocal(ASTContext &Context, SourceLocation Loc)
Definition: TypeLoc.h:2031
SourceRange getLocalSourceRange() const
Definition: TypeLoc.h:2027
QualType getInnerType() const
Definition: TypeLoc.h:2037
SourceLocation getNameLoc() const
Definition: TypeLoc.h:2023
QualType getElementType() const
Definition: TypeBase.h:4205
#define bool
Definition: gpuintrin.h:32
The JSON file list parser is used to communicate input to InstallAPI.
TypeSpecifierType
Specifies the kind of type.
Definition: Specifiers.h:55
@ TST_unspecified
Definition: Specifiers.h:56
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
Definition: TypeBase.h:1792
@ Keyword
The name has been typo-corrected to a keyword.
TypeSpecifierWidth
Specifies the width of a type, e.g., short, long, or long long.
Definition: Specifiers.h:47
TypeSpecifierSign
Specifies the signedness of a type, e.g., signed or unsigned.
Definition: Specifiers.h:50
const FunctionProtoType * T
@ None
The alignment was not explicit in code.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
Definition: TypeBase.h:5881
@ None
No keyword precedes the qualified type name.
@ Other
Other implicit parameter.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
SourceLocation LBracketLoc
Definition: TypeLoc.h:1749
SourceLocation RBracketLoc
Definition: TypeLoc.h:1749
SourceLocation KWLoc
Definition: TypeLoc.h:2763
SourceLocation RParenLoc
Definition: TypeLoc.h:2763
SourceLocation LParenLoc
Definition: TypeLoc.h:2763
const Attr * TypeAttr
Definition: TypeLoc.h:1010
ConceptReference * CR
Definition: TypeLoc.h:2364
SourceLocation RParenLoc
Definition: TypeLoc.h:2362
SourceRange BuiltinRange
Definition: TypeLoc.h:575
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
SourceLocation RParenLoc
Definition: TypeLoc.h:2259
SourceLocation DecltypeLoc
Definition: TypeLoc.h:2258
void * QualifierData
Data associated with the nested-name-specifier location.
Definition: TypeLoc.h:2480
SourceLocation NameLoc
Definition: TypeLoc.h:2549
SourceLocation ElaboratedKWLoc
Definition: TypeLoc.h:2540
void * QualifierData
Data associated with the nested-name-specifier location.
Definition: TypeLoc.h:2543
ElaboratedNameLocInfo(SourceLocation ElaboratedKeywordLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation NameLoc)
Definition: TypeLoc.h:702
SourceLocation NameLoc
Definition: TypeLoc.h:698
SourceLocation ElaboratedKeywordLoc
Definition: TypeLoc.h:699
SourceRange getLocalSourceRange(NestedNameSpecifier Qualifier) const
Definition: TypeLoc.h:719
ElaboratedNameLocInfo(ASTContext &Context, ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, SourceLocation Loc)
Definition: TypeLoc.h:707
NestedNameSpecifierLoc getQualifierLoc(NestedNameSpecifier Qualifier) const
Definition: TypeLoc.h:714
SourceLocation LParenLoc
Definition: TypeLoc.h:1615
SourceLocation RParenLoc
Definition: TypeLoc.h:1616
SourceLocation LocalRangeEnd
Definition: TypeLoc.h:1617
SourceLocation LocalRangeBegin
Definition: TypeLoc.h:1614
SourceLocation ExpansionLoc
Definition: TypeLoc.h:1342
SourceLocation AttrLoc
Definition: TypeLoc.h:2092
SourceRange OperandParens
Definition: TypeLoc.h:2093
SourceLocation NameEndLoc
Definition: TypeLoc.h:1276
SourceLocation NameLoc
Definition: TypeLoc.h:1275
SourceLocation TypeArgsLAngleLoc
Definition: TypeLoc.h:1136
SourceLocation ProtocolLAngleLoc
Definition: TypeLoc.h:1138
SourceLocation TypeArgsRAngleLoc
Definition: TypeLoc.h:1137
SourceLocation ProtocolRAngleLoc
Definition: TypeLoc.h:1139
SourceLocation EllipsisLoc
Definition: TypeLoc.h:2284
SourceLocation LParenLoc
Definition: TypeLoc.h:1375
SourceLocation RParenLoc
Definition: TypeLoc.h:1376
SourceLocation KWLoc
Definition: TypeLoc.h:2822
SourceLocation StarLoc
Definition: TypeLoc.h:1458
SourceLocation NameLoc
Definition: TypeLoc.h:793
SourceLocation ElaboratedKWLoc
Definition: TypeLoc.h:794
Location information for a TemplateArgument.
Definition: TemplateBase.h:480
SourceLocation NameLoc
Definition: TypeLoc.h:1840
TypeSourceInfo * UnmodifiedTInfo
Definition: TypeLoc.h:2169
SourceLocation NameLoc
Definition: TypeLoc.h:537
SourceLocation RParenLoc
Definition: TypeLoc.h:2162
SourceLocation LParenLoc
Definition: TypeLoc.h:2161
SourceLocation TypeofLoc
Definition: TypeLoc.h:2160
TypeSourceInfo * UnderlyingTInfo
Definition: TypeLoc.h:2315
SourceLocation NameLoc
Definition: TypeLoc.h:2017
Structure that packs information about the type specifiers that were written in a particular type spe...
Definition: Specifiers.h:109