clang 19.0.0git
ASTNodeTraverser.h
Go to the documentation of this file.
1//===--- ASTNodeTraverser.h - Traversal of AST nodes ----------------------===//
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// This file implements the AST traversal facilities. Other users
10// of this class may make use of the same traversal logic by inheriting it,
11// similar to RecursiveASTVisitor.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_AST_ASTNODETRAVERSER_H
16#define LLVM_CLANG_AST_ASTNODETRAVERSER_H
17
25#include "clang/AST/Type.h"
28#include "llvm/Support/SaveAndRestore.h"
29
30namespace clang {
31
32class APValue;
33
34/**
35
36ASTNodeTraverser traverses the Clang AST for dumping purposes.
37
38The `Derived::doGetNodeDelegate()` method is required to be an accessible member
39which returns a reference of type `NodeDelegateType &` which implements the
40following interface:
41
42struct {
43 template <typename Fn> void AddChild(Fn DoAddChild);
44 template <typename Fn> void AddChild(StringRef Label, Fn DoAddChild);
45
46 void Visit(const comments::Comment *C, const comments::FullComment *FC);
47 void Visit(const Attr *A);
48 void Visit(const TemplateArgument &TA, SourceRange R = {},
49 const Decl *From = nullptr, StringRef Label = {});
50 void Visit(const Stmt *Node);
51 void Visit(const Type *T);
52 void Visit(QualType T);
53 void Visit(TypeLoc);
54 void Visit(const Decl *D);
55 void Visit(const CXXCtorInitializer *Init);
56 void Visit(const OMPClause *C);
57 void Visit(const BlockDecl::Capture &C);
58 void Visit(const GenericSelectionExpr::ConstAssociation &A);
59 void Visit(const concepts::Requirement *R);
60 void Visit(const APValue &Value, QualType Ty);
61};
62*/
63template <typename Derived, typename NodeDelegateType>
65 : public ConstDeclVisitor<Derived>,
66 public ConstStmtVisitor<Derived>,
67 public comments::ConstCommentVisitor<Derived, void,
68 const comments::FullComment *>,
69 public TypeVisitor<Derived>,
70 public TypeLocVisitor<Derived>,
71 public ConstAttrVisitor<Derived>,
72 public ConstTemplateArgumentVisitor<Derived> {
73
74 /// Indicates whether we should trigger deserialization of nodes that had
75 /// not already been loaded.
76 bool Deserialize = false;
77
78 /// Tracks whether we should dump TypeLocs etc.
79 ///
80 /// Detailed location information such as TypeLoc nodes is not usually
81 /// included in the dump (too verbose).
82 /// But when explicitly asked to dump a Loc node, we do so recursively,
83 /// including e.g. FunctionTypeLoc => ParmVarDecl => TypeLoc.
84 bool VisitLocs = false;
85
87
88 NodeDelegateType &getNodeDelegate() {
89 return getDerived().doGetNodeDelegate();
90 }
91 Derived &getDerived() { return *static_cast<Derived *>(this); }
92
93public:
94 void setDeserialize(bool D) { Deserialize = D; }
95 bool getDeserialize() const { return Deserialize; }
96
99
100 void Visit(const Decl *D, bool VisitLocs = false) {
102 return;
103
104 getNodeDelegate().AddChild([=] {
105 getNodeDelegate().Visit(D);
106 if (!D)
107 return;
108
109 {
110 llvm::SaveAndRestore RestoreVisitLocs(this->VisitLocs, VisitLocs);
112 }
113
114 for (const auto &A : D->attrs())
115 Visit(A);
116
117 if (const comments::FullComment *Comment =
119 Visit(Comment, Comment);
120
121 // Decls within functions are visited by the body.
122 if (!isa<FunctionDecl, ObjCMethodDecl, BlockDecl>(*D)) {
123 if (Traversal != TK_AsIs) {
124 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D)) {
125 auto SK = CTSD->getSpecializationKind();
128 return;
129 }
130 }
131 if (const auto *DC = dyn_cast<DeclContext>(D))
132 dumpDeclContext(DC);
133 }
134 });
135 }
136
137 void Visit(const Stmt *Node, StringRef Label = {}) {
138 getNodeDelegate().AddChild(Label, [=] {
139 const Stmt *S = Node;
140
141 if (auto *E = dyn_cast_or_null<Expr>(S)) {
142 switch (Traversal) {
143 case TK_AsIs:
144 break;
146 S = E->IgnoreUnlessSpelledInSource();
147 break;
148 }
149 }
150
151 getNodeDelegate().Visit(S);
152
153 if (!S) {
154 return;
155 }
156
158
159 // Some statements have custom mechanisms for dumping their children.
160 if (isa<DeclStmt>(S) || isa<GenericSelectionExpr>(S) ||
161 isa<RequiresExpr>(S))
162 return;
163
164 if (Traversal == TK_IgnoreUnlessSpelledInSource &&
165 isa<LambdaExpr, CXXForRangeStmt, CallExpr,
166 CXXRewrittenBinaryOperator>(S))
167 return;
168
169 for (const Stmt *SubStmt : S->children())
170 Visit(SubStmt);
171 });
172 }
173
174 void Visit(QualType T) {
175 SplitQualType SQT = T.split();
176 if (!SQT.Quals.hasQualifiers())
177 return Visit(SQT.Ty);
178
179 getNodeDelegate().AddChild([=] {
180 getNodeDelegate().Visit(T);
181 Visit(T.split().Ty);
182 });
183 }
184
185 void Visit(const Type *T) {
186 getNodeDelegate().AddChild([=] {
187 getNodeDelegate().Visit(T);
188 if (!T)
189 return;
191
192 QualType SingleStepDesugar =
194 if (SingleStepDesugar != QualType(T, 0))
195 Visit(SingleStepDesugar);
196 });
197 }
198
199 void Visit(TypeLoc T) {
200 getNodeDelegate().AddChild([=] {
201 getNodeDelegate().Visit(T);
202 if (T.isNull())
203 return;
205 if (auto Inner = T.getNextTypeLoc())
206 Visit(Inner);
207 });
208 }
209
210 void Visit(const Attr *A) {
211 getNodeDelegate().AddChild([=] {
212 getNodeDelegate().Visit(A);
214 });
215 }
216
218 if (Traversal == TK_IgnoreUnlessSpelledInSource && !Init->isWritten())
219 return;
220 getNodeDelegate().AddChild([=] {
221 getNodeDelegate().Visit(Init);
222 Visit(Init->getInit());
223 });
224 }
225
226 void Visit(const TemplateArgument &A, SourceRange R = {},
227 const Decl *From = nullptr, const char *Label = nullptr) {
228 getNodeDelegate().AddChild([=] {
229 getNodeDelegate().Visit(A, R, From, Label);
231 });
232 }
233
235 getNodeDelegate().AddChild([=] {
236 getNodeDelegate().Visit(C);
237 if (C.hasCopyExpr())
238 Visit(C.getCopyExpr());
239 });
240 }
241
242 void Visit(const OMPClause *C) {
243 getNodeDelegate().AddChild([=] {
244 getNodeDelegate().Visit(C);
245 for (const auto *S : C->children())
246 Visit(S);
247 });
248 }
249
251 getNodeDelegate().AddChild([=] {
252 getNodeDelegate().Visit(A);
253 if (const TypeSourceInfo *TSI = A.getTypeSourceInfo())
254 Visit(TSI->getType());
255 Visit(A.getAssociationExpr());
256 });
257 }
258
260 getNodeDelegate().AddChild([=] {
261 getNodeDelegate().Visit(R);
262 if (!R)
263 return;
264 if (auto *TR = dyn_cast<concepts::TypeRequirement>(R)) {
265 if (!TR->isSubstitutionFailure())
266 Visit(TR->getType()->getType().getTypePtr());
267 } else if (auto *ER = dyn_cast<concepts::ExprRequirement>(R)) {
268 if (!ER->isExprSubstitutionFailure())
269 Visit(ER->getExpr());
270 if (!ER->getReturnTypeRequirement().isEmpty())
271 Visit(ER->getReturnTypeRequirement()
272 .getTypeConstraint()
273 ->getImmediatelyDeclaredConstraint());
274 } else if (auto *NR = dyn_cast<concepts::NestedRequirement>(R)) {
275 if (!NR->hasInvalidConstraint())
276 Visit(NR->getConstraintExpr());
277 }
278 });
279 }
280
281 void Visit(const ConceptReference *R) {
282 getNodeDelegate().AddChild([=] { getNodeDelegate().Visit(R); });
283 }
284
285 void Visit(const APValue &Value, QualType Ty) {
286 getNodeDelegate().AddChild([=] { getNodeDelegate().Visit(Value, Ty); });
287 }
288
290 getNodeDelegate().AddChild([=] {
291 getNodeDelegate().Visit(C, FC);
292 if (!C) {
293 return;
294 }
295 comments::ConstCommentVisitor<Derived, void,
297 FC);
298 for (comments::Comment::child_iterator I = C->child_begin(),
299 E = C->child_end();
300 I != E; ++I)
301 Visit(*I, FC);
302 });
303 }
304
305 void Visit(const DynTypedNode &N) {
306 // FIXME: Improve this with a switch or a visitor pattern.
307 if (const auto *D = N.get<Decl>())
308 Visit(D);
309 else if (const auto *S = N.get<Stmt>())
310 Visit(S);
311 else if (const auto *QT = N.get<QualType>())
312 Visit(*QT);
313 else if (const auto *T = N.get<Type>())
314 Visit(T);
315 else if (const auto *TL = N.get<TypeLoc>())
316 Visit(*TL);
317 else if (const auto *C = N.get<CXXCtorInitializer>())
318 Visit(C);
319 else if (const auto *C = N.get<OMPClause>())
320 Visit(C);
321 else if (const auto *T = N.get<TemplateArgument>())
322 Visit(*T);
323 else if (const auto *CR = N.get<ConceptReference>())
324 Visit(CR);
325 }
326
327 void dumpDeclContext(const DeclContext *DC) {
328 if (!DC)
329 return;
330
331 for (const auto *D : (Deserialize ? DC->decls() : DC->noload_decls()))
332 Visit(D);
333 }
334
336 if (!TPL)
337 return;
338
339 for (const auto &TP : *TPL)
340 Visit(TP);
341
342 if (const Expr *RC = TPL->getRequiresClause())
343 Visit(RC);
344 }
345
346 void
348 if (!TALI)
349 return;
350
351 for (const auto &TA : TALI->arguments())
353 }
354
356 const Decl *From = nullptr,
357 const char *Label = nullptr) {
358 Visit(A.getArgument(), A.getSourceRange(), From, Label);
359 }
360
362 for (unsigned i = 0, e = TAL.size(); i < e; ++i)
363 Visit(TAL[i]);
364 }
365
366 void dumpObjCTypeParamList(const ObjCTypeParamList *typeParams) {
367 if (!typeParams)
368 return;
369
370 for (const auto &typeParam : *typeParams) {
371 Visit(typeParam);
372 }
373 }
374
378 }
381 Visit(T->getPointeeType());
382 }
384 Visit(T->getPointeeType());
385 }
387 Visit(T->getClass());
388 Visit(T->getPointeeType());
389 }
393 Visit(T->getSizeExpr());
394 }
396 Visit(T->getElementType());
397 Visit(T->getSizeExpr());
398 }
400 Visit(T->getElementType());
401 Visit(T->getSizeExpr());
402 }
407 for (const QualType &PT : T->getParamTypes())
408 Visit(PT);
409 }
412 }
415 }
416
418 Visit(T->getPattern());
419 Visit(T->getIndexExpr());
420 }
421
423 Visit(T->getBaseType());
424 }
426 // FIXME: AttrKind
427 if (T->getModifiedType() != T->getEquivalentType())
429 }
431 Visit(T->getWrappedType());
432 }
434 void
437 }
439 for (const auto &Arg : T->template_arguments())
440 Visit(Arg);
441 }
443 Visit(T->getPointeeType());
444 }
446 void VisitPipeType(const PipeType *T) { Visit(T->getElementType()); }
449 if (!T->isSugared())
450 Visit(T->getPattern());
451 }
452 void VisitAutoType(const AutoType *T) {
453 for (const auto &Arg : T->getTypeConstraintArguments())
454 Visit(Arg);
455 }
456 // FIXME: ElaboratedType, DependentNameType,
457 // DependentTemplateSpecializationType, ObjCObjectType
458
459 // For TypeLocs, we automatically visit the inner type loc (pointee type etc).
460 // We must explicitly visit other lexically-nested nodes.
463 for (const auto *Param : TL.getParams())
464 Visit(Param, /*VisitTypeLocs=*/true);
465 }
467 if (const auto *CR = TL.getConceptReference()) {
468 if (auto *Args = CR->getTemplateArgsAsWritten())
469 for (const auto &Arg : Args->arguments())
471 }
472 }
475 }
477 Visit(TL.getSizeExpr());
478 }
480 Visit(TL.getSizeExpr());
481 }
483 Visit(cast<DependentSizedExtVectorType>(TL.getType())->getSizeExpr());
484 }
487 }
490 }
492 for (unsigned I=0, N=TL.getNumArgs(); I < N; ++I)
494 }
497 for (unsigned I=0, N=TL.getNumArgs(); I < N; ++I)
499 }
500
502
504 if (const Expr *Init = D->getInitExpr())
505 Visit(Init);
506 }
507
511 dumpTemplateArgumentList(*FTSI->TemplateArguments);
514 dumpASTTemplateArgumentListInfo(DFTSI->TemplateArgumentsAsWritten);
515
516 if (D->param_begin())
517 for (const auto *Parameter : D->parameters())
519
520 if (const Expr *TRC = D->getTrailingRequiresClause())
521 Visit(TRC);
522
524 return;
525
526 if (const auto *C = dyn_cast<CXXConstructorDecl>(D))
527 for (const auto *I : C->inits())
528 Visit(I);
529
531 Visit(D->getBody());
532 }
533
534 void VisitFieldDecl(const FieldDecl *D) {
535 if (D->isBitField())
536 Visit(D->getBitWidth());
537 if (Expr *Init = D->getInClassInitializer())
538 Visit(Init);
539 }
540
541 void VisitVarDecl(const VarDecl *D) {
543 return;
544
545 if (const auto *TSI = D->getTypeSourceInfo(); VisitLocs && TSI)
546 Visit(TSI->getTypeLoc());
547 if (D->hasInit())
548 Visit(D->getInit());
549 }
550
552 VisitVarDecl(D);
553 for (const auto *B : D->bindings())
554 Visit(B);
555 }
556
559 return;
560
561 if (const auto *V = D->getHoldingVar())
562 Visit(V);
563
564 if (const auto *E = D->getBinding())
565 Visit(E);
566 }
567
569 Visit(D->getAsmString());
570 }
571
573
574 void VisitCapturedDecl(const CapturedDecl *D) { Visit(D->getBody()); }
575
577 for (const auto *E : D->varlists())
578 Visit(E);
579 }
580
582 Visit(D->getCombiner());
583 if (const auto *Initializer = D->getInitializer())
585 }
586
588 for (const auto *C : D->clauselists())
589 Visit(C);
590 }
591
593 Visit(D->getInit());
594 }
595
597 for (const auto *E : D->varlists())
598 Visit(E);
599 for (const auto *C : D->clauselists())
600 Visit(C);
601 }
602
603 template <typename SpecializationDecl>
604 void dumpTemplateDeclSpecialization(const SpecializationDecl *D) {
605 for (const auto *RedeclWithBadType : D->redecls()) {
606 // FIXME: The redecls() range sometimes has elements of a less-specific
607 // type. (In particular, ClassTemplateSpecializationDecl::redecls() gives
608 // us TagDecls, and should give CXXRecordDecls).
609 auto *Redecl = dyn_cast<SpecializationDecl>(RedeclWithBadType);
610 if (!Redecl) {
611 // Found the injected-class-name for a class template. This will be
612 // dumped as part of its surrounding class so we don't need to dump it
613 // here.
614 assert(isa<CXXRecordDecl>(RedeclWithBadType) &&
615 "expected an injected-class-name");
616 continue;
617 }
618 Visit(Redecl);
619 }
620 }
621
622 template <typename TemplateDecl>
625
627
628 if (Traversal == TK_AsIs) {
629 for (const auto *Child : D->specializations())
631 }
632 }
633
636 }
637
641 }
642
644 Visit(D->getAssertExpr());
645 Visit(D->getMessage());
646 }
647
650 }
651
654 }
655
659 }
660
665 }
666
668
671 }
672
673 void
676 VisitVarDecl(D);
677 }
678
683 }
684
686 if (const auto *TC = D->getTypeConstraint())
687 Visit(TC->getImmediatelyDeclaredConstraint());
688 if (D->hasDefaultArgument())
691 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
692 }
693
695 if (const auto *E = D->getPlaceholderTypeConstraint())
696 Visit(E);
697 if (D->hasDefaultArgument())
700 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
701 }
702
705 if (D->hasDefaultArgument())
708 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
709 }
710
714 }
715
718 for (const TemplateArgument &Arg : CSD->getTemplateArguments())
719 Visit(Arg);
720 }
721
724 if (CSE->hasExplicitTemplateArgs())
725 for (const auto &ArgLoc : CSE->getTemplateArgsAsWritten()->arguments())
727 }
728
730 if (auto *TD = dyn_cast<TypeDecl>(D->getUnderlyingDecl()))
731 Visit(TD->getTypeForDecl());
732 }
733
735 if (D->getFriendType()) {
736 // Traverse any CXXRecordDecl owned by this type, since
737 // it will not be in the parent context:
738 if (auto *ET = D->getFriendType()->getType()->getAs<ElaboratedType>())
739 if (auto *TD = ET->getOwnedTagDecl())
740 Visit(TD);
741 } else {
742 Visit(D->getFriendDecl());
743 }
744 }
745
749 else
750 for (const ParmVarDecl *Parameter : D->parameters())
752
753 if (D->hasBody())
754 Visit(D->getBody());
755 }
756
759 }
760
763 }
764
766 for (const auto &I : D->inits())
767 Visit(I);
768 }
769
770 void VisitBlockDecl(const BlockDecl *D) {
771 for (const auto &I : D->parameters())
772 Visit(I);
773
774 for (const auto &I : D->captures())
775 Visit(I);
776 Visit(D->getBody());
777 }
778
780 for (const auto &D : Node->decls())
781 Visit(D);
782 }
783
785 for (const auto *A : Node->getAttrs())
786 Visit(A);
787 }
788
790 Visit(Node->getExceptionDecl());
791 }
792
794 Visit(Node->getCapturedDecl());
795 }
796
798 for (const auto *C : Node->clauses())
799 Visit(C);
800 }
801
803 if (auto *Filler = ILE->getArrayFiller()) {
804 Visit(Filler, "array_filler");
805 }
806 }
807
809 if (auto *Filler = PLIE->getArrayFiller()) {
810 Visit(Filler, "array_filler");
811 }
812 }
813
814 void VisitBlockExpr(const BlockExpr *Node) { Visit(Node->getBlockDecl()); }
815
817 if (Expr *Source = Node->getSourceExpr())
818 Visit(Source);
819 }
820
822 if (E->isExprPredicate()) {
824 Visit(E->getControllingExpr()->getType()); // FIXME: remove
825 } else
827
828 for (const auto Assoc : E->associations()) {
829 Visit(Assoc);
830 }
831 }
832
834 for (auto *D : E->getLocalParameters())
835 Visit(D);
836 for (auto *R : E->getRequirements())
837 Visit(R);
838 }
839
842 for (unsigned I = 0, N = Node->capture_size(); I != N; ++I) {
843 const auto *C = Node->capture_begin() + I;
844 if (!C->isExplicit())
845 continue;
846 if (Node->isInitCapture(C))
847 Visit(C->getCapturedVar());
848 else
849 Visit(Node->capture_init_begin()[I]);
850 }
851 dumpTemplateParameters(Node->getTemplateParameterList());
852 for (const auto *P : Node->getCallOperator()->parameters())
853 Visit(P);
854 Visit(Node->getBody());
855 } else {
856 return Visit(Node->getLambdaClass());
857 }
858 }
859
861 if (Node->isPartiallySubstituted())
862 for (const auto &A : Node->getPartialArguments())
863 Visit(A);
864 }
865
867 Visit(E->getParameter());
868 }
873 }
874
876 if (const VarDecl *CatchParam = Node->getCatchParamDecl())
877 Visit(CatchParam);
878 }
879
882 Visit(Node->getInit());
883 Visit(Node->getLoopVariable());
884 Visit(Node->getRangeInit());
885 Visit(Node->getBody());
886 }
887 }
888
890 for (const auto *Child :
891 make_filter_range(Node->children(), [this](const Stmt *Child) {
892 if (Traversal != TK_IgnoreUnlessSpelledInSource)
893 return false;
894 return !isa<CXXDefaultArgExpr>(Child);
895 })) {
896 Visit(Child);
897 }
898 }
899
902 Visit(Node->getLHS());
903 Visit(Node->getRHS());
904 } else {
906 }
907 }
908
910 Visit(TA.getAsExpr());
911 }
912
914 Visit(TA.getAsType());
915 }
916
918 for (const auto &TArg : TA.pack_elements())
919 Visit(TArg);
920 }
921
922 // Implements Visit methods for Attrs.
923#include "clang/AST/AttrNodeTraverse.inc"
924};
925
926} // namespace clang
927
928#endif // LLVM_CLANG_AST_ASTNODETRAVERSER_H
#define V(N, I)
Definition: ASTContext.h:3259
DynTypedNode Node
TraversalKind Traversal
C Language Family Type Representation.
std::string Label
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition: APValue.h:122
comments::FullComment * getLocalCommentForDeclUncached(const Decl *D) const
Return parsed documentation comment attached to a given declaration.
Definition: ASTContext.cpp:573
ASTNodeTraverser traverses the Clang AST for dumping purposes.
void VisitSubstNonTypeTemplateParmPackExpr(const SubstNonTypeTemplateParmPackExpr *E)
void VisitDeclStmt(const DeclStmt *Node)
void VisitFunctionType(const FunctionType *T)
void VisitCapturedDecl(const CapturedDecl *D)
void VisitDependentTemplateSpecializationTypeLoc(DependentTemplateSpecializationTypeLoc TL)
void Visit(const BlockDecl::Capture &C)
void VisitAdjustedType(const AdjustedType *T)
void VisitDependentSizedExtVectorTypeLoc(DependentSizedExtVectorTypeLoc TL)
void VisitSizeOfPackExpr(const SizeOfPackExpr *Node)
void VisitMemberPointerType(const MemberPointerType *T)
void VisitDependentSizedArrayType(const DependentSizedArrayType *T)
void VisitTypeOfExprType(const TypeOfExprType *T)
void VisitLocInfoType(const LocInfoType *T)
void dumpTemplateDeclSpecialization(const SpecializationDecl *D)
void Visit(const comments::Comment *C, const comments::FullComment *FC)
void VisitDependentSizedArrayTypeLoc(DependentSizedArrayTypeLoc TL)
void VisitClassTemplateSpecializationDecl(const ClassTemplateSpecializationDecl *D)
void VisitBlockDecl(const BlockDecl *D)
void VisitFunctionProtoTypeLoc(FunctionProtoTypeLoc TL)
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *Node)
void VisitTemplateSpecializationTypeLoc(TemplateSpecializationTypeLoc TL)
void VisitPackIndexingType(const PackIndexingType *T)
void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D)
void VisitCXXParenListInitExpr(const CXXParenListInitExpr *PLIE)
void dumpTemplateArgumentList(const TemplateArgumentList &TAL)
void Visit(const OMPClause *C)
void VisitImplicitConceptSpecializationDecl(const ImplicitConceptSpecializationDecl *CSD)
void VisitReferenceType(const ReferenceType *T)
void VisitBlockExpr(const BlockExpr *Node)
void VisitDecltypeType(DecltypeType TL)
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
void VisitStaticAssertDecl(const StaticAssertDecl *D)
void VisitBlockPointerType(const BlockPointerType *T)
void VisitFieldDecl(const FieldDecl *D)
void VisitAttributedStmt(const AttributedStmt *Node)
void Visit(const Type *T)
void VisitPipeType(const PipeType *T)
void Visit(const Attr *A)
void VisitInitListExpr(const InitListExpr *ILE)
void VisitVarTemplateDecl(const VarTemplateDecl *D)
void VisitPackExpansionType(const PackExpansionType *T)
void VisitBTFTagAttributedType(const BTFTagAttributedType *T)
void VisitTypeAliasDecl(const TypeAliasDecl *D)
void VisitDecompositionDecl(const DecompositionDecl *D)
void VisitObjCMethodDecl(const ObjCMethodDecl *D)
void VisitClassTemplateDecl(const ClassTemplateDecl *D)
void Visit(const Decl *D, bool VisitLocs=false)
void SetTraversalKind(TraversalKind TK)
void Visit(const concepts::Requirement *R)
void VisitOMPCapturedExprDecl(const OMPCapturedExprDecl *D)
void VisitComplexType(const ComplexType *T)
void dumpDeclContext(const DeclContext *DC)
void VisitUsingShadowDecl(const UsingShadowDecl *D)
void dumpObjCTypeParamList(const ObjCTypeParamList *typeParams)
void VisitVarTemplateSpecializationDecl(const VarTemplateSpecializationDecl *D)
void Visit(const DynTypedNode &N)
void VisitExpressionTemplateArgument(const TemplateArgument &TA)
void dumpTemplateDecl(const TemplateDecl *D)
void VisitVectorType(const VectorType *T)
void dumpTemplateArgumentLoc(const TemplateArgumentLoc &A, const Decl *From=nullptr, const char *Label=nullptr)
void VisitCXXCatchStmt(const CXXCatchStmt *Node)
void VisitClassTemplatePartialSpecializationDecl(const ClassTemplatePartialSpecializationDecl *D)
void VisitTypedefDecl(const TypedefDecl *D)
void Visit(const ConceptReference *R)
void VisitBindingDecl(const BindingDecl *D)
void Visit(const APValue &Value, QualType Ty)
void VisitVariableArrayTypeLoc(VariableArrayTypeLoc TL)
void VisitRequiresExpr(const RequiresExpr *E)
void VisitGenericSelectionExpr(const GenericSelectionExpr *E)
void VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T)
void VisitOpaqueValueExpr(const OpaqueValueExpr *Node)
void VisitArrayType(const ArrayType *T)
void Visit(const CXXCtorInitializer *Init)
void VisitVarDecl(const VarDecl *D)
void VisitVarTemplatePartialSpecializationDecl(const VarTemplatePartialSpecializationDecl *D)
void VisitFileScopeAsmDecl(const FileScopeAsmDecl *D)
void VisitAutoType(const AutoType *T)
void VisitFunctionProtoType(const FunctionProtoType *T)
void VisitUnaryTransformType(const UnaryTransformType *T)
void VisitTypeOfExprTypeLoc(TypeOfExprTypeLoc TL)
void VisitLambdaExpr(const LambdaExpr *Node)
void VisitCallExpr(const CallExpr *Node)
void VisitDecltypeType(const DecltypeType *T)
void VisitMemberPointerTypeLoc(MemberPointerTypeLoc TL)
void VisitOMPExecutableDirective(const OMPExecutableDirective *Node)
void VisitEnumConstantDecl(const EnumConstantDecl *D)
void VisitTemplateSpecializationType(const TemplateSpecializationType *T)
void VisitAtomicType(const AtomicType *T)
void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *T)
void Visit(const Stmt *Node, StringRef Label={})
void Visit(const GenericSelectionExpr::ConstAssociation &A)
void VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D)
void VisitConceptDecl(const ConceptDecl *D)
void VisitTopLevelStmtDecl(const TopLevelStmtDecl *D)
void dumpASTTemplateArgumentListInfo(const ASTTemplateArgumentListInfo *TALI)
void VisitConceptSpecializationExpr(const ConceptSpecializationExpr *CSE)
void VisitVariableArrayType(const VariableArrayType *T)
void VisitTypeTemplateArgument(const TemplateArgument &TA)
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
void VisitOMPAllocateDecl(const OMPAllocateDecl *D)
void VisitOMPThreadPrivateDecl(const OMPThreadPrivateDecl *D)
void VisitCapturedStmt(const CapturedStmt *Node)
void VisitFriendDecl(const FriendDecl *D)
void VisitSubstNonTypeTemplateParmExpr(const SubstNonTypeTemplateParmExpr *E)
void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D)
void VisitCXXForRangeStmt(const CXXForRangeStmt *Node)
void VisitOMPDeclareMapperDecl(const OMPDeclareMapperDecl *D)
void VisitObjCObjectPointerType(const ObjCObjectPointerType *T)
void VisitAttributedType(const AttributedType *T)
void Visit(const TemplateArgument &A, SourceRange R={}, const Decl *From=nullptr, const char *Label=nullptr)
void VisitPackTemplateArgument(const TemplateArgument &TA)
TraversalKind GetTraversalKind() const
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
void VisitAutoTypeLoc(AutoTypeLoc TL)
void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *)
void VisitCXXRewrittenBinaryOperator(const CXXRewrittenBinaryOperator *Node)
void dumpTemplateParameters(const TemplateParameterList *TPL)
void VisitFunctionDecl(const FunctionDecl *D)
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D)
void VisitOMPDeclareReductionDecl(const OMPDeclareReductionDecl *D)
void VisitPointerType(const PointerType *T)
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons.
Definition: Type.h:2926
QualType getOriginalType() const
Definition: Type.h:2939
Expr * getSizeExpr() const
Definition: TypeLoc.h:1557
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:3146
QualType getElementType() const
Definition: Type.h:3158
QualType getValueType() const
Gets the type contained by this atomic type, i.e.
Definition: Type.h:6731
Attr - This represents one attribute.
Definition: Attr.h:42
Represents an attribute applied to a statement.
Definition: Stmt.h:2078
An attributed type is a type to which a type attribute has been applied.
Definition: Type.h:5146
QualType getModifiedType() const
Definition: Type.h:5168
QualType getEquivalentType() const
Definition: Type.h:5169
ConceptReference * getConceptReference() const
Definition: TypeLoc.h:2172
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
Definition: Type.h:5523
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
Definition: Type.h:5533
QualType getWrappedType() const
Definition: Type.h:5258
A binding in a decomposition declaration.
Definition: DeclCXX.h:4100
VarDecl * getHoldingVar() const
Get the variable (if any) that holds the value of evaluating the binding.
Definition: DeclCXX.cpp:3337
Expr * getBinding() const
Get the expression to which this declaration is bound.
Definition: DeclCXX.h:4124
A class which contains all the information about a particular captured value.
Definition: Decl.h:4461
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4455
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
Definition: Decl.h:4534
ArrayRef< Capture > captures() const
Definition: Decl.h:4582
ArrayRef< ParmVarDecl * > parameters() const
Definition: Decl.h:4541
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:6156
Pointer to a block type.
Definition: Type.h:2977
QualType getPointeeType() const
Definition: Type.h:2989
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:28
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2293
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition: StmtCXX.h:135
Represents a list-initialization with parenthesis.
Definition: ExprCXX.h:4913
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:283
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2808
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4647
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
Definition: Decl.cpp:5383
This captures a statement into a function.
Definition: Stmt.h:3755
Declaration of a class template.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Represents a class template specialization, which refers to a class template with a given set of temp...
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
Complex values, per C99 6.2.5p11.
Definition: Type.h:2844
QualType getElementType() const
Definition: Type.h:2854
Declaration of a C++20 concept.
Expr * getConstraintExpr() const
A reference to a concept and its template args, as it appears in the code.
Definition: ASTConcept.h:128
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:42
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ExprConcepts.h:98
const ImplicitConceptSpecializationDecl * getSpecializationDecl() const
Definition: ExprConcepts.h:116
A simple visitor class that helps create attribute visitors.
Definition: AttrVisitor.h:71
A simple visitor class that helps create declaration visitors.
Definition: DeclVisitor.h:74
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
Definition: StmtVisitor.h:195
A simple visitor class that helps create template argument visitors.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1436
decl_range noload_decls() const
noload_decls_begin/end - Iterate over the declarations stored in this context that are currently load...
Definition: DeclBase.h:2329
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Definition: DeclBase.h:2321
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition: Stmt.h:1495
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:85
ASTContext & getASTContext() const LLVM_READONLY
Definition: DeclBase.cpp:501
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:598
attr_range attrs() const
Definition: DeclBase.h:540
Expr * getTrailingRequiresClause()
Get the constraint-expression introduced by the trailing requires-clause in the function/member decla...
Definition: Decl.h:846
TypeSourceInfo * getTypeSourceInfo() const
Definition: Decl.h:799
Represents the type decltype(expr) (C++11).
Definition: Type.h:4900
Expr * getUnderlyingExpr() const
Definition: Type.h:4910
A decomposition declaration.
Definition: DeclCXX.h:4159
ArrayRef< BindingDecl * > bindings() const
Definition: DeclCXX.h:4191
const ParmDecl * getInheritedFrom() const
Get the parameter from which we inherit the default argument, if any.
Definition: DeclTemplate.h:345
Provides information about a dependent function-template specialization declaration.
Definition: DeclTemplate.h:690
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3343
Expr * getSizeExpr() const
Definition: Type.h:3363
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3441
QualType getElementType() const
Definition: Type.h:3456
TemplateArgumentLoc getArgLoc(unsigned i) const
Definition: TypeLoc.h:2501
A dynamically typed AST node container.
const T * get() const
Retrieve the stored node as type T.
Represents a type that was referred to using an elaborated type keyword, e.g., struct S,...
Definition: Type.h:5913
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:3265
const Expr * getInitExpr() const
Definition: Decl.h:3283
This represents one expression.
Definition: Expr.h:110
QualType getType() const
Definition: Expr.h:142
Represents a member of a struct/union/class.
Definition: Decl.h:3025
Expr * getInClassInitializer() const
Get the C++11 default member initializer for this member, or null if one has not been set.
Definition: Decl.cpp:4527
bool isBitField() const
Determines whether this field is a bitfield.
Definition: Decl.h:3116
Expr * getBitWidth() const
Returns the expression that represents the bit width, if this field is a bit field.
Definition: Decl.h:3129
const StringLiteral * getAsmString() const
Definition: Decl.h:4409
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition: DeclFriend.h:54
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
Definition: DeclFriend.h:137
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition: DeclFriend.h:122
Represents a function declaration or definition.
Definition: Decl.h:1959
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
Definition: Decl.cpp:3191
ArrayRef< ParmVarDecl * > parameters() const
Definition: Decl.h:2651
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
Definition: Decl.cpp:4127
param_iterator param_begin()
Definition: Decl.h:2663
bool doesThisDeclarationHaveABody() const
Returns whether this specific declaration of the function has a body.
Definition: Decl.h:2270
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
Definition: Decl.cpp:4194
bool isDefaulted() const
Whether this function is defaulted.
Definition: Decl.h:2322
Represents a prototype with parameter type info, e.g.
Definition: Type.h:4198
ArrayRef< QualType > getParamTypes() const
Definition: Type.h:4438
Declaration of a template function.
Definition: DeclTemplate.h:958
Provides information about a function template specialization, which is a FunctionDecl that has been ...
Definition: DeclTemplate.h:467
ArrayRef< ParmVarDecl * > getParams() const
Definition: TypeLoc.h:1465
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3798
QualType getReturnType() const
Definition: Type.h:4115
Represents a C11 generic selection.
Definition: Expr.h:5708
TypeSourceInfo * getControllingType()
Return the controlling type of this generic selection expression.
Definition: Expr.h:5983
bool isExprPredicate() const
Whether this generic selection uses an expression as its controlling argument.
Definition: Expr.h:5964
association_range associations()
Definition: Expr.h:6039
AssociationTy< true > ConstAssociation
Definition: Expr.h:5940
Expr * getControllingExpr()
Return the controlling expression of this generic selection expression.
Definition: Expr.h:5971
ArrayRef< TemplateArgument > getTemplateArguments() const
Describes an C or C++ initializer list.
Definition: Expr.h:4830
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition: Expr.h:4924
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1938
Holds a QualType and a TypeSourceInfo* that came out of a declarator parsing.
Definition: LocInfoType.h:28
TypeSourceInfo * getTypeSourceInfo() const
Definition: LocInfoType.h:45
Wrapper for source info for member pointers.
Definition: TypeLoc.h:1306
TypeSourceInfo * getClassTInfo() const
Definition: TypeLoc.h:1320
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: Type.h:3088
QualType getPointeeType() const
Definition: Type.h:3104
const Type * getClass() const
Definition: Type.h:3118
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
Definition: Decl.h:462
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
const DefArgStorage & getDefaultArgStorage() const
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
Expr * getPlaceholderTypeConstraint() const
Return the constraint introduced by the placeholder type of this non-type template parameter (if any)...
This represents '#pragma omp allocate ...' directive.
Definition: DeclOpenMP.h:473
varlist_range varlists()
Definition: DeclOpenMP.h:515
clauselist_range clauselists()
Definition: DeclOpenMP.h:526
Pseudo declaration for capturing expressions.
Definition: DeclOpenMP.h:383
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:55
This represents '#pragma omp declare mapper ...' directive.
Definition: DeclOpenMP.h:287
clauselist_range clauselists()
Definition: DeclOpenMP.h:333
This represents '#pragma omp declare reduction ...' directive.
Definition: DeclOpenMP.h:177
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
Definition: DeclOpenMP.h:238
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
Definition: DeclOpenMP.h:220
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
This represents '#pragma omp threadprivate ...' directive.
Definition: DeclOpenMP.h:110
varlist_range varlists()
Definition: DeclOpenMP.h:146
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2323
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
Definition: DeclObjC.h:2373
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2595
Represents an ObjC class declaration.
Definition: DeclObjC.h:1150
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class.
Definition: DeclObjC.h:1300
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:140
bool hasBody() const override
Determine whether this method has a body.
Definition: DeclObjC.h:523
ArrayRef< ParmVarDecl * > parameters() const
Definition: DeclObjC.h:373
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
Definition: DeclObjC.cpp:909
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
Definition: DeclObjC.h:534
Represents a pointer to an Objective C object.
Definition: Type.h:6550
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
Definition: Type.h:6562
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
Definition: DeclObjC.h:658
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1168
Represents a pack expansion of types.
Definition: Type.h:6111
bool isSugared() const
Definition: Type.h:6142
QualType getPattern() const
Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated w...
Definition: Type.h:6132
QualType getPattern() const
Definition: Type.h:4960
Expr * getIndexExpr() const
Definition: Type.h:4959
Represents a parameter to a function.
Definition: Decl.h:1749
PipeType - OpenCL20.
Definition: Type.h:6750
QualType getElementType() const
Definition: Type.h:6761
PointerType - C99 6.7.5.1 - Pointer Declarators.
Definition: Type.h:2897
QualType getPointeeType() const
Definition: Type.h:2907
A (possibly-)qualified type.
Definition: Type.h:737
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:6922
bool hasQualifiers() const
Return true if the set contains any qualifiers.
Definition: Type.h:439
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:3008
QualType getPointeeType() const
Definition: Type.h:3026
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:510
ArrayRef< concepts::Requirement * > getRequirements() const
Definition: ExprConcepts.h:556
ArrayRef< ParmVarDecl * > getLocalParameters() const
Definition: ExprConcepts.h:550
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4220
A trivial tuple used to represent a source range.
Represents a C++11 static_assert declaration.
Definition: DeclCXX.h:4051
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:44
Stmt - This represents one statement.
Definition: Stmt.h:84
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4435
NonTypeTemplateParmDecl * getParameter() const
Definition: ExprCXX.cpp:1663
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Definition: ExprCXX.h:4520
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Definition: ExprCXX.cpp:1730
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
Definition: ExprCXX.cpp:1725
Represents the result of substituting a set of types for a template type parameter pack.
Definition: Type.h:5431
TemplateArgument getArgumentPack() const
Definition: Type.cpp:4067
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:5361
A template argument list.
Definition: DeclTemplate.h:244
unsigned size() const
Retrieve the number of template arguments in this template argument list.
Definition: DeclTemplate.h:280
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:524
const TemplateArgument & getArgument() const
Definition: TemplateBase.h:574
SourceRange getSourceRange() const LLVM_READONLY
Represents a template argument.
Definition: TemplateBase.h:61
Expr * getAsExpr() const
Retrieve the template argument as an expression.
Definition: TemplateBase.h:408
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:319
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
Definition: TemplateBase.h:432
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:394
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
Definition: DeclTemplate.h:426
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Definition: DeclTemplate.h:413
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:73
Expr * getRequiresClause()
The constraint-expression of the associated requires-clause.
Definition: DeclTemplate.h:180
TemplateArgumentLoc getArgLoc(unsigned i) const
Definition: TypeLoc.h:1664
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:5631
ArrayRef< TemplateArgument > template_arguments() const
Definition: Type.h:5699
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
const DefArgStorage & getDefaultArgStorage() const
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Declaration of a template type parameter.
QualType getDefaultArgument() const
Retrieve the default argument, if any.
const TypeConstraint * getTypeConstraint() const
Returns the type constraint associated with this template parameter (if any).
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
const DefArgStorage & getDefaultArgStorage() const
A declaration that models statements at global scope.
Definition: Decl.h:4422
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3521
Declaration of an alias template.
TypeAliasDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
RetTy Visit(TypeLoc TyLoc)
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:59
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:170
bool isNull() const
Definition: TypeLoc.h:121
Expr * getUnderlyingExpr() const
Definition: TypeLoc.h:2009
Represents a typeof (or typeof) expression (a C23 feature and GCC extension) or a typeof_unqual expre...
Definition: Type.h:4816
Expr * getUnderlyingExpr() const
Definition: Type.h:4825
A container of type source information.
Definition: Type.h:6872
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
Definition: TypeLoc.h:256
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:6883
An operation on a type.
Definition: TypeVisitor.h:64
RetTy Visit(const Type *T)
Performs the operation associated with this visitor object.
Definition: TypeVisitor.h:68
The base class of the type hierarchy.
Definition: Type.h:1606
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
Definition: Type.cpp:444
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:7652
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3501
QualType getUnderlyingType() const
Definition: Decl.h:3454
A unary type transform, which is a type constructed from another.
Definition: Type.h:5008
QualType getBaseType() const
Definition: Type.h:5035
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3313
Represents a variable declaration or definition.
Definition: Decl.h:918
bool hasInit() const
Definition: Decl.cpp:2395
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement.
Definition: Decl.h:1499
const Expr * getInit() const
Definition: Decl.h:1352
Declaration of a variable template.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Represents a variable template specialization, which refers to a variable template with a given set o...
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:3289
Expr * getSizeExpr() const
Definition: Type.h:3308
Represents a GCC generic vector type.
Definition: Type.h:3511
QualType getElementType() const
Definition: Type.h:3525
RetTy Visit(PTR(Attr) A)
Definition: AttrVisitor.h:31
RetTy visit(PTR(Comment) C, ParamTys... P)
Any part of the comment.
Definition: Comment.h:65
Comment *const * child_iterator
Definition: Comment.h:251
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1083
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:168
RetTy Visit(PTR(Decl) D)
Definition: DeclVisitor.h:37
RetTy Visit(REF(TemplateArgument) TA, ParamTys... P)
The JSON file list parser is used to communicate input to InstallAPI.
TraversalKind
Defines how we descend a level in the AST when we pass through expressions.
Definition: ASTTypeTraits.h:38
@ TK_AsIs
Will traverse all child nodes.
Definition: ASTTypeTraits.h:40
@ TK_IgnoreUnlessSpelledInSource
Ignore AST nodes not written in the source.
Definition: ASTTypeTraits.h:43
@ Parameter
The parameter type of a method or function.
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
Definition: Specifiers.h:203
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
Definition: Specifiers.h:199
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:676
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
Definition: TemplateBase.h:705
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:670
const Type * Ty
The locally-unqualified type.
Definition: Type.h:672
Qualifiers Quals
The local qualifiers.
Definition: Type.h:675