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 OpenACCClause *C);
57 void Visit(const OMPClause *C);
58 void Visit(const BlockDecl::Capture &C);
59 void Visit(const GenericSelectionExpr::ConstAssociation &A);
60 void Visit(const concepts::Requirement *R);
61 void Visit(const APValue &Value, QualType Ty);
62};
63*/
64template <typename Derived, typename NodeDelegateType>
66 : public ConstDeclVisitor<Derived>,
67 public ConstStmtVisitor<Derived>,
68 public comments::ConstCommentVisitor<Derived, void,
69 const comments::FullComment *>,
70 public TypeVisitor<Derived>,
71 public TypeLocVisitor<Derived>,
72 public ConstAttrVisitor<Derived>,
73 public ConstTemplateArgumentVisitor<Derived> {
74
75 /// Indicates whether we should trigger deserialization of nodes that had
76 /// not already been loaded.
77 bool Deserialize = false;
78
79 /// Tracks whether we should dump TypeLocs etc.
80 ///
81 /// Detailed location information such as TypeLoc nodes is not usually
82 /// included in the dump (too verbose).
83 /// But when explicitly asked to dump a Loc node, we do so recursively,
84 /// including e.g. FunctionTypeLoc => ParmVarDecl => TypeLoc.
85 bool VisitLocs = false;
86
88
89 NodeDelegateType &getNodeDelegate() {
90 return getDerived().doGetNodeDelegate();
91 }
92 Derived &getDerived() { return *static_cast<Derived *>(this); }
93
94public:
95 void setDeserialize(bool D) { Deserialize = D; }
96 bool getDeserialize() const { return Deserialize; }
97
100
101 void Visit(const Decl *D, bool VisitLocs = false) {
103 return;
104
105 getNodeDelegate().AddChild([=] {
106 getNodeDelegate().Visit(D);
107 if (!D)
108 return;
109
110 {
111 llvm::SaveAndRestore RestoreVisitLocs(this->VisitLocs, VisitLocs);
113 }
114
115 for (const auto &A : D->attrs())
116 Visit(A);
117
118 if (const comments::FullComment *Comment =
120 Visit(Comment, Comment);
121
122 // Decls within functions are visited by the body.
123 if (!isa<FunctionDecl, ObjCMethodDecl, BlockDecl>(*D)) {
124 if (Traversal != TK_AsIs) {
125 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D)) {
126 auto SK = CTSD->getSpecializationKind();
129 return;
130 }
131 }
132 if (const auto *DC = dyn_cast<DeclContext>(D))
133 dumpDeclContext(DC);
134 }
135 });
136 }
137
138 void Visit(const Stmt *Node, StringRef Label = {}) {
139 getNodeDelegate().AddChild(Label, [=] {
140 const Stmt *S = Node;
141
142 if (auto *E = dyn_cast_or_null<Expr>(S)) {
143 switch (Traversal) {
144 case TK_AsIs:
145 break;
147 S = E->IgnoreUnlessSpelledInSource();
148 break;
149 }
150 }
151
152 getNodeDelegate().Visit(S);
153
154 if (!S) {
155 return;
156 }
157
159
160 // Some statements have custom mechanisms for dumping their children.
161 if (isa<DeclStmt>(S) || isa<GenericSelectionExpr>(S) ||
162 isa<RequiresExpr>(S))
163 return;
164
165 if (Traversal == TK_IgnoreUnlessSpelledInSource &&
166 isa<LambdaExpr, CXXForRangeStmt, CallExpr,
167 CXXRewrittenBinaryOperator>(S))
168 return;
169
170 for (const Stmt *SubStmt : S->children())
171 Visit(SubStmt);
172 });
173 }
174
176 SplitQualType SQT = T.split();
177 if (!SQT.Quals.hasQualifiers())
178 return Visit(SQT.Ty);
179
180 getNodeDelegate().AddChild([=] {
181 getNodeDelegate().Visit(T);
182 Visit(T.split().Ty);
183 });
184 }
185
186 void Visit(const Type *T) {
187 getNodeDelegate().AddChild([=] {
188 getNodeDelegate().Visit(T);
189 if (!T)
190 return;
192
193 QualType SingleStepDesugar =
195 if (SingleStepDesugar != QualType(T, 0))
196 Visit(SingleStepDesugar);
197 });
198 }
199
201 getNodeDelegate().AddChild([=] {
202 getNodeDelegate().Visit(T);
203 if (T.isNull())
204 return;
206 if (auto Inner = T.getNextTypeLoc())
207 Visit(Inner);
208 });
209 }
210
211 void Visit(const Attr *A) {
212 getNodeDelegate().AddChild([=] {
213 getNodeDelegate().Visit(A);
215 });
216 }
217
219 if (Traversal == TK_IgnoreUnlessSpelledInSource && !Init->isWritten())
220 return;
221 getNodeDelegate().AddChild([=] {
222 getNodeDelegate().Visit(Init);
223 Visit(Init->getInit());
224 });
225 }
226
227 void Visit(const TemplateArgument &A, SourceRange R = {},
228 const Decl *From = nullptr, const char *Label = nullptr) {
229 getNodeDelegate().AddChild([=] {
230 getNodeDelegate().Visit(A, R, From, Label);
232 });
233 }
234
236 getNodeDelegate().AddChild([=] {
237 getNodeDelegate().Visit(C);
238 if (C.hasCopyExpr())
239 Visit(C.getCopyExpr());
240 });
241 }
242
243 void Visit(const OpenACCClause *C) {
244 getNodeDelegate().AddChild([=] {
245 getNodeDelegate().Visit(C);
246 for (const auto *S : C->children())
247 Visit(S);
248 });
249 }
250
251 void Visit(const OMPClause *C) {
252 getNodeDelegate().AddChild([=] {
253 getNodeDelegate().Visit(C);
254 for (const auto *S : C->children())
255 Visit(S);
256 });
257 }
258
260 getNodeDelegate().AddChild([=] {
261 getNodeDelegate().Visit(A);
262 if (const TypeSourceInfo *TSI = A.getTypeSourceInfo())
263 Visit(TSI->getType());
264 Visit(A.getAssociationExpr());
265 });
266 }
267
269 getNodeDelegate().AddChild([=] {
270 getNodeDelegate().Visit(R);
271 if (!R)
272 return;
273 if (auto *TR = dyn_cast<concepts::TypeRequirement>(R)) {
274 if (!TR->isSubstitutionFailure())
275 Visit(TR->getType()->getType().getTypePtr());
276 } else if (auto *ER = dyn_cast<concepts::ExprRequirement>(R)) {
277 if (!ER->isExprSubstitutionFailure())
278 Visit(ER->getExpr());
279 if (!ER->getReturnTypeRequirement().isEmpty())
280 Visit(ER->getReturnTypeRequirement()
281 .getTypeConstraint()
282 ->getImmediatelyDeclaredConstraint());
283 } else if (auto *NR = dyn_cast<concepts::NestedRequirement>(R)) {
284 if (!NR->hasInvalidConstraint())
285 Visit(NR->getConstraintExpr());
286 }
287 });
288 }
289
290 void Visit(const ConceptReference *R) {
291 getNodeDelegate().AddChild([=] { getNodeDelegate().Visit(R); });
292 }
293
294 void Visit(const APValue &Value, QualType Ty) {
295 getNodeDelegate().AddChild([=] { getNodeDelegate().Visit(Value, Ty); });
296 }
297
299 getNodeDelegate().AddChild([=] {
300 getNodeDelegate().Visit(C, FC);
301 if (!C) {
302 return;
303 }
304 comments::ConstCommentVisitor<Derived, void,
306 FC);
307 for (comments::Comment::child_iterator I = C->child_begin(),
308 E = C->child_end();
309 I != E; ++I)
310 Visit(*I, FC);
311 });
312 }
313
314 void Visit(const DynTypedNode &N) {
315 // FIXME: Improve this with a switch or a visitor pattern.
316 if (const auto *D = N.get<Decl>())
317 Visit(D);
318 else if (const auto *S = N.get<Stmt>())
319 Visit(S);
320 else if (const auto *QT = N.get<QualType>())
321 Visit(*QT);
322 else if (const auto *T = N.get<Type>())
323 Visit(T);
324 else if (const auto *TL = N.get<TypeLoc>())
325 Visit(*TL);
326 else if (const auto *C = N.get<CXXCtorInitializer>())
327 Visit(C);
328 else if (const auto *C = N.get<OMPClause>())
329 Visit(C);
330 else if (const auto *T = N.get<TemplateArgument>())
331 Visit(*T);
332 else if (const auto *CR = N.get<ConceptReference>())
333 Visit(CR);
334 }
335
336 void dumpDeclContext(const DeclContext *DC) {
337 if (!DC)
338 return;
339
340 for (const auto *D : (Deserialize ? DC->decls() : DC->noload_decls()))
341 Visit(D);
342 }
343
345 if (!TPL)
346 return;
347
348 for (const auto &TP : *TPL)
349 Visit(TP);
350
351 if (const Expr *RC = TPL->getRequiresClause())
352 Visit(RC);
353 }
354
355 void
357 if (!TALI)
358 return;
359
360 for (const auto &TA : TALI->arguments())
362 }
363
365 const Decl *From = nullptr,
366 const char *Label = nullptr) {
367 Visit(A.getArgument(), A.getSourceRange(), From, Label);
368 }
369
371 for (unsigned i = 0, e = TAL.size(); i < e; ++i)
372 Visit(TAL[i]);
373 }
374
375 void dumpObjCTypeParamList(const ObjCTypeParamList *typeParams) {
376 if (!typeParams)
377 return;
378
379 for (const auto &typeParam : *typeParams) {
380 Visit(typeParam);
381 }
382 }
383
384 void VisitComplexType(const ComplexType *T) { Visit(T->getElementType()); }
386 Visit(T->getTypeSourceInfo()->getTypeLoc());
387 }
391 }
394 }
396 Visit(T->getClass());
398 }
399 void VisitArrayType(const ArrayType *T) { Visit(T->getElementType()); }
402 Visit(T->getSizeExpr());
403 }
405 Visit(T->getElementType());
406 Visit(T->getSizeExpr());
407 }
409 Visit(T->getElementType());
410 Visit(T->getSizeExpr());
411 }
412 void VisitVectorType(const VectorType *T) { Visit(T->getElementType()); }
416 for (const QualType &PT : T->getParamTypes())
417 Visit(PT);
418 }
420 Visit(T->getUnderlyingExpr());
421 }
423 Visit(T->getUnderlyingExpr());
424 }
425
427 Visit(T->getPattern());
428 Visit(T->getIndexExpr());
429 }
430
432 Visit(T->getBaseType());
433 }
435 // FIXME: AttrKind
436 if (T->getModifiedType() != T->getEquivalentType())
437 Visit(T->getModifiedType());
438 }
440 Visit(T->getWrappedType());
441 }
443 void
445 Visit(T->getArgumentPack());
446 }
448 for (const auto &Arg : T->template_arguments())
449 Visit(Arg);
450 }
453 }
454 void VisitAtomicType(const AtomicType *T) { Visit(T->getValueType()); }
455 void VisitPipeType(const PipeType *T) { Visit(T->getElementType()); }
456 void VisitAdjustedType(const AdjustedType *T) { Visit(T->getOriginalType()); }
458 if (!T->isSugared())
459 Visit(T->getPattern());
460 }
461 void VisitAutoType(const AutoType *T) {
462 for (const auto &Arg : T->getTypeConstraintArguments())
463 Visit(Arg);
464 }
465 // FIXME: ElaboratedType, DependentNameType,
466 // DependentTemplateSpecializationType, ObjCObjectType
467
468 // For TypeLocs, we automatically visit the inner type loc (pointee type etc).
469 // We must explicitly visit other lexically-nested nodes.
472 for (const auto *Param : TL.getParams())
473 Visit(Param, /*VisitTypeLocs=*/true);
474 }
476 if (const auto *CR = TL.getConceptReference()) {
477 if (auto *Args = CR->getTemplateArgsAsWritten())
478 for (const auto &Arg : Args->arguments())
480 }
481 }
484 }
486 Visit(TL.getSizeExpr());
487 }
489 Visit(TL.getSizeExpr());
490 }
492 Visit(cast<DependentSizedExtVectorType>(TL.getType())->getSizeExpr());
493 }
496 }
499 }
501 for (unsigned I=0, N=TL.getNumArgs(); I < N; ++I)
503 }
506 for (unsigned I=0, N=TL.getNumArgs(); I < N; ++I)
508 }
509
511
513 if (const Expr *Init = D->getInitExpr())
514 Visit(Init);
515 }
516
520 dumpTemplateArgumentList(*FTSI->TemplateArguments);
523 dumpASTTemplateArgumentListInfo(DFTSI->TemplateArgumentsAsWritten);
524
525 if (D->param_begin())
526 for (const auto *Parameter : D->parameters())
528
529 if (const Expr *TRC = D->getTrailingRequiresClause())
530 Visit(TRC);
531
533 return;
534
535 if (const auto *C = dyn_cast<CXXConstructorDecl>(D))
536 for (const auto *I : C->inits())
537 Visit(I);
538
540 Visit(D->getBody());
541 }
542
543 void VisitFieldDecl(const FieldDecl *D) {
544 if (D->isBitField())
545 Visit(D->getBitWidth());
546 if (Expr *Init = D->getInClassInitializer())
547 Visit(Init);
548 }
549
550 void VisitVarDecl(const VarDecl *D) {
552 return;
553
554 if (const auto *TSI = D->getTypeSourceInfo(); VisitLocs && TSI)
555 Visit(TSI->getTypeLoc());
556 if (D->hasInit())
557 Visit(D->getInit());
558 }
559
561 VisitVarDecl(D);
562 for (const auto *B : D->bindings())
563 Visit(B);
564 }
565
568 return;
569
570 if (const auto *V = D->getHoldingVar())
571 Visit(V);
572
573 if (const auto *E = D->getBinding())
574 Visit(E);
575 }
576
578 Visit(D->getAsmString());
579 }
580
582
583 void VisitCapturedDecl(const CapturedDecl *D) { Visit(D->getBody()); }
584
586 for (const auto *E : D->varlists())
587 Visit(E);
588 }
589
591 Visit(D->getCombiner());
592 if (const auto *Initializer = D->getInitializer())
594 }
595
597 for (const auto *C : D->clauselists())
598 Visit(C);
599 }
600
602 Visit(D->getInit());
603 }
604
606 for (const auto *E : D->varlists())
607 Visit(E);
608 for (const auto *C : D->clauselists())
609 Visit(C);
610 }
611
612 template <typename SpecializationDecl>
613 void dumpTemplateDeclSpecialization(const SpecializationDecl *D) {
614 for (const auto *RedeclWithBadType : D->redecls()) {
615 // FIXME: The redecls() range sometimes has elements of a less-specific
616 // type. (In particular, ClassTemplateSpecializationDecl::redecls() gives
617 // us TagDecls, and should give CXXRecordDecls).
618 auto *Redecl = dyn_cast<SpecializationDecl>(RedeclWithBadType);
619 if (!Redecl) {
620 // Found the injected-class-name for a class template. This will be
621 // dumped as part of its surrounding class so we don't need to dump it
622 // here.
623 assert(isa<CXXRecordDecl>(RedeclWithBadType) &&
624 "expected an injected-class-name");
625 continue;
626 }
627 Visit(Redecl);
628 }
629 }
630
631 template <typename TemplateDecl>
634
636
637 if (Traversal == TK_AsIs) {
638 for (const auto *Child : D->specializations())
640 }
641 }
642
645 }
646
650 }
651
653 Visit(D->getAssertExpr());
654 Visit(D->getMessage());
655 }
656
659 }
660
663 }
664
668 }
669
674 }
675
677
680 }
681
682 void
685 VisitVarDecl(D);
686 }
687
692 }
693
695 if (const auto *TC = D->getTypeConstraint())
696 Visit(TC->getImmediatelyDeclaredConstraint());
697 if (D->hasDefaultArgument())
700 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
701 }
702
704 if (const auto *E = D->getPlaceholderTypeConstraint())
705 Visit(E);
706 if (D->hasDefaultArgument())
709 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
710 }
711
714 if (D->hasDefaultArgument())
717 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
718 }
719
723 }
724
727 for (const TemplateArgument &Arg : CSD->getTemplateArguments())
728 Visit(Arg);
729 }
730
733 if (CSE->hasExplicitTemplateArgs())
734 for (const auto &ArgLoc : CSE->getTemplateArgsAsWritten()->arguments())
736 }
737
739 if (auto *TD = dyn_cast<TypeDecl>(D->getUnderlyingDecl()))
740 Visit(TD->getTypeForDecl());
741 }
742
744 if (D->getFriendType()) {
745 // Traverse any CXXRecordDecl owned by this type, since
746 // it will not be in the parent context:
747 if (auto *ET = D->getFriendType()->getType()->getAs<ElaboratedType>())
748 if (auto *TD = ET->getOwnedTagDecl())
749 Visit(TD);
750 } else {
751 Visit(D->getFriendDecl());
752 }
753 }
754
758 else
759 for (const ParmVarDecl *Parameter : D->parameters())
761
762 if (D->hasBody())
763 Visit(D->getBody());
764 }
765
768 }
769
772 }
773
775 for (const auto &I : D->inits())
776 Visit(I);
777 }
778
779 void VisitBlockDecl(const BlockDecl *D) {
780 for (const auto &I : D->parameters())
781 Visit(I);
782
783 for (const auto &I : D->captures())
784 Visit(I);
785 Visit(D->getBody());
786 }
787
789 for (const auto &D : Node->decls())
790 Visit(D);
791 }
792
794 for (const auto *A : Node->getAttrs())
795 Visit(A);
796 }
797
799 Visit(Node->getExceptionDecl());
800 }
801
803 Visit(Node->getCapturedDecl());
804 }
805
807 for (const auto *C : Node->clauses())
808 Visit(C);
809 }
810
812 for (const auto *C : Node->clauses())
813 Visit(C);
814 }
815
817 if (auto *Filler = ILE->getArrayFiller()) {
818 Visit(Filler, "array_filler");
819 }
820 }
821
823 if (auto *Filler = PLIE->getArrayFiller()) {
824 Visit(Filler, "array_filler");
825 }
826 }
827
828 void VisitBlockExpr(const BlockExpr *Node) { Visit(Node->getBlockDecl()); }
829
831 if (Expr *Source = Node->getSourceExpr())
832 Visit(Source);
833 }
834
836 if (E->isExprPredicate()) {
838 Visit(E->getControllingExpr()->getType()); // FIXME: remove
839 } else
841
842 for (const auto Assoc : E->associations()) {
843 Visit(Assoc);
844 }
845 }
846
848 for (auto *D : E->getLocalParameters())
849 Visit(D);
850 for (auto *R : E->getRequirements())
851 Visit(R);
852 }
853
855 // Argument types are not children of the TypeTraitExpr.
856 for (auto *A : E->getArgs())
857 Visit(A->getType());
858 }
859
862 for (unsigned I = 0, N = Node->capture_size(); I != N; ++I) {
863 const auto *C = Node->capture_begin() + I;
864 if (!C->isExplicit())
865 continue;
866 if (Node->isInitCapture(C))
867 Visit(C->getCapturedVar());
868 else
869 Visit(Node->capture_init_begin()[I]);
870 }
871 dumpTemplateParameters(Node->getTemplateParameterList());
872 for (const auto *P : Node->getCallOperator()->parameters())
873 Visit(P);
874 Visit(Node->getBody());
875 } else {
876 return Visit(Node->getLambdaClass());
877 }
878 }
879
881 if (Node->isPartiallySubstituted())
882 for (const auto &A : Node->getPartialArguments())
883 Visit(A);
884 }
885
887 Visit(E->getParameter());
888 }
893 }
894
896 if (const VarDecl *CatchParam = Node->getCatchParamDecl())
897 Visit(CatchParam);
898 }
899
902 Visit(Node->getInit());
903 Visit(Node->getLoopVariable());
904 Visit(Node->getRangeInit());
905 Visit(Node->getBody());
906 }
907 }
908
910 for (const auto *Child :
911 make_filter_range(Node->children(), [this](const Stmt *Child) {
912 if (Traversal != TK_IgnoreUnlessSpelledInSource)
913 return false;
914 return !isa<CXXDefaultArgExpr>(Child);
915 })) {
916 Visit(Child);
917 }
918 }
919
922 Visit(Node->getLHS());
923 Visit(Node->getRHS());
924 } else {
926 }
927 }
928
930 Visit(TA.getAsExpr());
931 }
932
934 Visit(TA.getAsType());
935 }
936
938 for (const auto &TArg : TA.pack_elements())
939 Visit(TArg);
940 }
941
943 Visit(Node->getExpr());
944 }
945
947 Visit(Node->getExpr());
948 }
949
950 // Implements Visit methods for Attrs.
951#include "clang/AST/AttrNodeTraverse.inc"
952};
953
954} // namespace clang
955
956#endif // LLVM_CLANG_AST_ASTNODETRAVERSER_H
#define V(N, I)
Definition: ASTContext.h:3273
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 VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *Node)
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 VisitOpenACCConstructStmt(const OpenACCConstructStmt *Node)
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 VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *Node)
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 VisitTypeTraitExpr(const TypeTraitExpr *E)
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 Visit(const OpenACCClause *C)
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:3088
Expr * getSizeExpr() const
Definition: TypeLoc.h:1583
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:3308
Attr - This represents one attribute.
Definition: Attr.h:42
Represents an attribute applied to a statement.
Definition: Stmt.h:2080
An attributed type is a type to which a type attribute has been applied.
Definition: Type.h:5394
ConceptReference * getConceptReference() const
Definition: TypeLoc.h:2203
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
Definition: Type.h:5771
A binding in a decomposition declaration.
Definition: DeclCXX.h:4104
VarDecl * getHoldingVar() const
Get the variable (if any) that holds the value of evaluating the binding.
Definition: DeclCXX.cpp:3339
Expr * getBinding() const
Get the expression to which this declaration is bound.
Definition: DeclCXX.h:4128
A class which contains all the information about a particular captured value.
Definition: Decl.h:4501
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4495
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:4574
ArrayRef< Capture > captures() const
Definition: Decl.h:4622
ArrayRef< ParmVarDecl * > parameters() const
Definition: Decl.h:4581
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:6173
Pointer to a block type.
Definition: Type.h:3139
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:2297
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1264
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1371
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:4920
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:2820
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4687
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:5441
This captures a statement into a function.
Definition: Stmt.h:3757
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:2876
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:1438
decl_range noload_decls() const
noload_decls_begin/end - Iterate over the declarations stored in this context that are currently load...
Definition: DeclBase.h:2332
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Definition: DeclBase.h:2324
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition: Stmt.h:1497
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:601
attr_range attrs() const
Definition: DeclBase.h:543
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:5148
Expr * getUnderlyingExpr() const
Definition: Type.h:5158
A decomposition declaration.
Definition: DeclCXX.h:4163
ArrayRef< BindingDecl * > bindings() const
Definition: DeclCXX.h:4195
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:3591
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3689
TemplateArgumentLoc getArgLoc(unsigned i) const
Definition: TypeLoc.h:2532
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:6161
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:3298
const Expr * getInitExpr() const
Definition: Decl.h:3316
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:3058
Expr * getInClassInitializer() const
Get the C++11 default member initializer for this member, or null if one has not been set.
Definition: Decl.cpp:4572
bool isBitField() const
Determines whether this field is a bitfield.
Definition: Decl.h:3149
Expr * getBitWidth() const
Returns the expression that represents the bit width, if this field is a bit field.
Definition: Decl.h:3162
const StringLiteral * getAsmString() const
Definition: Decl.h:4445
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:1971
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
Definition: Decl.cpp:3236
ArrayRef< ParmVarDecl * > parameters() const
Definition: Decl.h:2684
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
Definition: Decl.cpp:4172
param_iterator param_begin()
Definition: Decl.h:2696
bool doesThisDeclarationHaveABody() const
Returns whether this specific declaration of the function has a body.
Definition: Decl.h:2296
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
Definition: Decl.cpp:4239
bool isDefaulted() const
Whether this function is defaulted.
Definition: Decl.h:2348
Represents a prototype with parameter type info, e.g.
Definition: Type.h:4446
ArrayRef< QualType > getParamTypes() const
Definition: Type.h:4686
bool isSugared() const
Definition: Type.h:4912
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:1491
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:4046
QualType getReturnType() const
Definition: Type.h:4363
Represents a C11 generic selection.
Definition: Expr.h:5725
TypeSourceInfo * getControllingType()
Return the controlling type of this generic selection expression.
Definition: Expr.h:6000
bool isExprPredicate() const
Whether this generic selection uses an expression as its controlling argument.
Definition: Expr.h:5981
association_range associations()
Definition: Expr.h:6056
AssociationTy< true > ConstAssociation
Definition: Expr.h:5957
Expr * getControllingExpr()
Return the controlling expression of this generic selection expression.
Definition: Expr.h:5988
ArrayRef< TemplateArgument > getTemplateArguments() const
Describes an C or C++ initializer list.
Definition: Expr.h:4847
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Definition: Expr.h:4941
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1948
Holds a QualType and a TypeSourceInfo* that came out of a declarator parsing.
Definition: LocInfoType.h:28
Wrapper for source info for member pointers.
Definition: TypeLoc.h:1332
TypeSourceInfo * getClassTInfo() const
Definition: TypeLoc.h:1346
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: Type.h:3250
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:2371
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2590
Represents an ObjC class declaration.
Definition: DeclObjC.h:1152
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:908
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:6798
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
This is the base type for all OpenACC Clauses.
Definition: OpenACCClause.h:22
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition: StmtOpenACC.h:25
Represents a pack expansion of types.
Definition: Type.h:6359
Represents a parameter to a function.
Definition: Decl.h:1761
PipeType - OpenCL20.
Definition: Type.h:6998
PointerType - C99 6.7.5.1 - Pointer Declarators.
Definition: Type.h:2929
A (possibly-)qualified type.
Definition: Type.h:738
bool hasQualifiers() const
Return true if the set contains any qualifiers.
Definition: Type.h:440
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:3170
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:4227
A trivial tuple used to represent a source range.
Represents a C++11 static_assert declaration.
Definition: DeclCXX.h:4055
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:4442
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:4527
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:5679
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:5609
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:1695
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:5879
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:4458
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3556
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
Expr * getUnderlyingExpr() const
Definition: TypeLoc.h:2040
Represents a typeof (or typeof) expression (a C23 feature and GCC extension) or a typeof_unqual expre...
Definition: Type.h:5064
A container of type source information.
Definition: Type.h:7120
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:7131
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2761
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
Definition: ExprCXX.h:2817
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:1607
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
Definition: Type.cpp:475
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
Definition: Type.cpp:694
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:7913
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3535
QualType getUnderlyingType() const
Definition: Decl.h:3488
A unary type transform, which is a type constructed from another.
Definition: Type.h:5256
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3317
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:1502
const Expr * getInit() const
Definition: Decl.h:1355
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:3537
Represents a GCC generic vector type.
Definition: Type.h:3759
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.
const FunctionProtoType * T
@ 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:671
const Type * Ty
The locally-unqualified type.
Definition: Type.h:673
Qualifiers Quals
The local qualifiers.
Definition: Type.h:676