clang: include/clang/AST/ASTNodeTraverser.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef LLVM_CLANG_AST_ASTNODETRAVERSER_H
16#define LLVM_CLANG_AST_ASTNODETRAVERSER_H
17
28#include "llvm/Support/SaveAndRestore.h"
29
31
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64template <typename Derived, typename NodeDelegateType>
69 const comments::FullComment *>,
74
75
76
77 bool Deserialize = false;
78
79
80
81
82
83
84
85 bool VisitLocs = false;
86
88
89 NodeDelegateType &getNodeDelegate() {
90 return getDerived().doGetNodeDelegate();
91 }
92 Derived &getDerived() { return *static_cast<Derived *>(this); }
93
94public:
97
100
101 void Visit(const Decl *D, bool VisitLocs = false) {
103 return;
104
105 getNodeDelegate().AddChild([=] {
106 getNodeDelegate().Visit(D);
107 if ()
108 return;
109
110 {
113 }
114
115 for (const auto &A : D->attrs())
117
119 D->getASTContext().getLocalCommentForDeclUncached(D))
120 Visit(Comment, Comment);
121
122
123 if (!isa<FunctionDecl, ObjCMethodDecl, BlockDecl>(*D)) {
125 if (const auto *CTSD = dyn_cast(D)) {
126 auto SK = CTSD->getSpecializationKind();
129 return;
130 }
131 }
132 if (const auto *DC = dyn_cast(D))
134 }
135 });
136 }
137
139 getNodeDelegate().AddChild(Label, [=] {
141
142 if (auto *E = dyn_cast_or_null(S)) {
143 switch (Traversal) {
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
161 if (isa<DeclStmt, GenericSelectionExpr, RequiresExpr,
162 OpenACCWaitConstruct, SYCLKernelCallStmt>(S))
163 return;
164
166 isa<LambdaExpr, CXXForRangeStmt, CallExpr,
167 CXXRewrittenBinaryOperator>(S))
168 return;
169
170 for (const Stmt *SubStmt : S->children())
172 });
173 }
174
179
180 getNodeDelegate().AddChild([=] {
181 getNodeDelegate().Visit(T);
183 });
184 }
185
187 getNodeDelegate().AddChild([=] {
188 getNodeDelegate().Visit(T);
189 if ()
190 return;
192
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())
208 });
209 }
210
212 getNodeDelegate().AddChild([=] {
213 getNodeDelegate().Visit(A);
215 });
216 }
217
220 return;
221 getNodeDelegate().AddChild([=] {
222 getNodeDelegate().Visit(Init);
224 });
225 }
226
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())
240 });
241 }
242
244 getNodeDelegate().AddChild([=] {
245 getNodeDelegate().Visit(C);
246 for (const auto *S : C->children())
248 });
249 }
250
252 getNodeDelegate().AddChild([=] {
253 getNodeDelegate().Visit(C);
254 for (const auto *S : C->children())
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_castconcepts::TypeRequirement(R)) {
274 if (!TR->isSubstitutionFailure())
275 Visit(TR->getType()->getType().getTypePtr());
276 } else if (auto *ER = dyn_castconcepts::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_castconcepts::NestedRequirement(R)) {
284 if (!NR->hasInvalidConstraint())
285 Visit(NR->getConstraintExpr());
286 }
287 });
288 }
289
291 getNodeDelegate().AddChild([=] { getNodeDelegate().Visit(R); });
292 }
293
295 getNodeDelegate().AddChild([=] { getNodeDelegate().Visit(Value, Ty); });
296 }
297
299 getNodeDelegate().AddChild([=] {
300 getNodeDelegate().Visit(C, FC);
301 if () {
302 return;
303 }
306 FC);
309 I != E; ++I)
311 });
312 }
313
315
316 if (const auto *D = N.get<Decl>())
318 else if (const auto *S = N.get<Stmt>())
320 else if (const auto *QT = N.get<QualType>())
322 else if (const auto *T = N.get<Type>())
324 else if (const auto *TL = N.get<TypeLoc>())
334 }
335
337 if (!DC)
338 return;
339
340 for (const auto *D : (Deserialize ? DC->decls() : DC->noload_decls()))
342 }
343
345 if (!TPL)
346 return;
347
348 for (const auto &TP : *TPL)
350
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) {
368 }
369
371 for (unsigned i = 0, e = TAL.size(); i < e; ++i)
373 }
374
376 if (!typeParams)
377 return;
378
379 for (const auto &typeParam : *typeParams) {
380 Visit(typeParam);
381 }
382 }
383
386 Visit(T->getTypeSourceInfo()->getTypeLoc());
387 }
391 }
394 }
398 }
403 }
405 Visit(T->getElementType());
407 }
409 Visit(T->getElementType());
411 }
418 }
420 Visit(T->getUnderlyingExpr());
421 }
423 Visit(T->getUnderlyingExpr());
424 }
425
429 }
430
433 }
435
436 if (T->getModifiedType() != T->getEquivalentType())
437 Visit(T->getModifiedType());
438 }
440 Visit(T->getWrappedType());
441 }
443 QualType Contained = T->getContainedType();
444 if (!Contained.isNull())
445 Visit(Contained);
446 }
448 void
450 Visit(T->getArgumentPack());
451 }
453 for (const auto &Arg : T->template_arguments())
455 }
458 }
465 }
467 for (const auto &Arg : T->getTypeConstraintArguments())
469 }
470
471
472
473
474
477 for (const auto *Param : TL.getParams())
478 Visit(Param, true);
479 }
482 if (auto *Args = CR->getTemplateArgsAsWritten())
483 for (const auto &Arg : Args->arguments())
485 }
486 }
489 }
492 }
495 }
497 Visit(cast(TL.getType())->getSizeExpr());
498 }
501 }
504 }
506 for (unsigned I=0, N=TL.getNumArgs(); I < N; ++I)
508 }
511 for (unsigned I=0, N=TL.getNumArgs(); I < N; ++I)
513 }
514
516
518 if (const Expr *Init = D->getInitExpr())
520 }
521
524 D->getTemplateSpecializationInfo())
527 D->getDependentSpecializationInfo())
529
530 if (D->param_begin())
531 for (const auto *Parameter : D->parameters())
533
534 if (const Expr *TRC = D->getTrailingRequiresClause())
536
538 return;
539
540 if (const auto *C = dyn_cast(D))
541 for (const auto *I : C->inits())
543
544 if (D->doesThisDeclarationHaveABody())
546 }
547
549 if (D->isBitField())
551 if (Expr *Init = D->getInClassInitializer())
553 }
554
557 return;
558
559 if (const auto *TSI = D->getTypeSourceInfo(); VisitLocs && TSI)
560 Visit(TSI->getTypeLoc());
561 if (D->hasInit())
563 }
564
567 for (const auto *B : D->bindings())
569 }
570
573 return;
574
575 if (const auto *V = D->getHoldingVar())
577
578 if (const auto *E = D->getBinding())
580 }
581
584 }
585
587
592 }
593
595
597 for (const auto *E : D->varlist())
599 }
600
603 if (const auto *Initializer = D->getInitializer())
605 }
606
608 for (const auto *C : D->clauselists())
610 }
611
614 }
615
617 for (const auto *E : D->varlist())
619 for (const auto *C : D->clauselists())
621 }
622
623 template
625 for (const auto *RedeclWithBadType : D->redecls()) {
626
627
628
629 auto *Redecl = dyn_cast(RedeclWithBadType);
630 if (!Redecl) {
631
632
633
634 assert(isa(RedeclWithBadType) &&
635 "expected an injected-class-name");
636 continue;
637 }
639 }
640 }
641
642 template
645
646 Visit(D->getTemplatedDecl());
647
649 for (const auto *Child : D->specializations())
651 }
652 }
653
655 Visit(D->getUnderlyingType());
656 }
657
660 Visit(D->getTemplatedDecl());
661 }
662
664 Visit(D->getAssertExpr());
666 }
667
670 }
671
674 }
675
679 }
680
685 }
686
688
691 }
692
693 void
697 }
698
703 }
704
706 if (const auto *TC = D->getTypeConstraint())
707 Visit(TC->getImmediatelyDeclaredConstraint());
708 if (D->hasDefaultArgument())
710 D->getDefaultArgStorage().getInheritedFrom(),
711 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
712 }
713
715 if (const auto *E = D->getPlaceholderTypeConstraint())
717 if (D->hasDefaultArgument())
719 D->getDefaultArgument(), D->getDefaultArgStorage().getInheritedFrom(),
720 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
721 }
722
725 if (D->hasDefaultArgument())
727 D->getDefaultArgument(), D->getDefaultArgStorage().getInheritedFrom(),
728 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
729 }
730
733 Visit(D->getConstraintExpr());
734 }
735
740 }
741
747 }
748
750 if (auto *TD = dyn_cast(D->getUnderlyingDecl()))
751 Visit(TD->getTypeForDecl());
752 }
753
755 if (D->getFriendType()) {
756
757
758 if (auto *ET = D->getFriendType()->getType()->getAs<ElaboratedType>())
759 if (auto *TD = ET->getOwnedTagDecl())
761 } else {
762 Visit(D->getFriendDecl());
763 }
764 }
765
767 if (D->isThisDeclarationADefinition())
769 else
772
773 if (D->hasBody())
775 }
776
779 }
780
783 }
784
786 for (const auto &I : D->inits())
788 }
789
791 for (const auto &I : D->parameters())
793
794 for (const auto &I : D->captures())
797 }
798
800 for (const auto &D : Node->decls())
802 }
803
805 for (const auto *A : Node->getAttrs())
807 }
808
810 if (Node->getDecl()->hasAttrs()) {
811 for (const auto *A : Node->getDecl()->getAttrs())
813 }
814 }
815
818 }
819
822 }
823
827 Visit(Node->getOutlinedFunctionDecl());
828 }
829
831 for (const auto *C : Node->clauses())
833 }
834
836 for (const auto *C : Node->clauses())
838 }
839
841
842
843
844 for (const Stmt *S : Node->children())
846 for (const auto *C : Node->clauses())
848 }
849
852 Visit(Filler, "array_filler");
853 }
854 }
855
858 Visit(Filler, "array_filler");
859 }
860 }
861
863
865 if (Expr *Source = Node->getSourceExpr())
867 }
868
870 if (E->isExprPredicate()) {
871 Visit(E->getControllingExpr());
872 Visit(E->getControllingExpr()->getType());
873 } else
874 Visit(E->getControllingType()->getType());
875
876 for (const auto Assoc : E->associations()) {
878 }
879 }
880
882 if (E->hasExplicitTemplateArgs())
883 for (auto Arg : E->template_arguments())
884 Visit(Arg.getArgument());
885 }
886
888 for (auto *D : E->getLocalParameters())
890 for (auto *R : E->getRequirements())
892 }
893
895
896 for (auto *A : E->getArgs())
897 Visit(A->getType());
898 }
899
902 for (unsigned I = 0, N = Node->capture_size(); I != N; ++I) {
903 const auto *C = Node->capture_begin() + I;
904 if (->isExplicit())
905 continue;
906 if (Node->isInitCapture(C))
907 Visit(C->getCapturedVar());
908 else
909 Visit(Node->capture_init_begin()[I]);
910 }
912 for (const auto *P : Node->getCallOperator()->parameters())
915 } else {
916 return Visit(Node->getLambdaClass());
917 }
918 }
919
921 if (Node->isPartiallySubstituted())
922 for (const auto &A : Node->getPartialArguments())
924 }
925
928 }
931 Visit(E->getParameterPack());
932 Visit(E->getArgumentPack());
933 }
934
936 if (const VarDecl *CatchParam = Node->getCatchParamDecl())
937 Visit(CatchParam);
938 }
939
946 }
947 }
948
950 for (const auto *Child :
951 make_filter_range(Node->children(), [this](const Stmt *Child) {
952 if (Traversal != TK_IgnoreUnlessSpelledInSource)
953 return false;
954 return !isa(Child);
955 })) {
957 }
958 }
959
964 } else {
966 }
967 }
968
971 }
972
975 }
976
980 }
981
984 }
985
988 }
989
990
991#include "clang/AST/AttrNodeTraverse.inc"
992};
993
994}
995
996#endif
C Language Family Type Representation.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
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 VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *E)
void VisitOpenACCWaitConstruct(const OpenACCWaitConstruct *Node)
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 VisitLabelStmt(const LabelStmt *Node)
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 VisitHLSLAttributedResourceType(const HLSLAttributedResourceType *T)
void VisitVectorType(const VectorType *T)
void dumpTemplateArgumentLoc(const TemplateArgumentLoc &A, const Decl *From=nullptr, const char *Label=nullptr)
void Visit(const OpenACCClause *C)
bool getDeserialize() const
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 setDeserialize(bool D)
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 VisitOutlinedFunctionDecl(const OutlinedFunctionDecl *D)
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 VisitSYCLKernelCallStmt(const SYCLKernelCallStmt *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.
Expr * getSizeExpr() const
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Attr - This represents one attribute.
Represents an attribute applied to a statement.
An attributed type is a type to which a type attribute has been applied.
ConceptReference * getConceptReference() const
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
A binding in a decomposition declaration.
A class which contains all the information about a particular captured value.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
CXXCatchStmt - This represents a C++ catch block.
Represents a C++ base or member initializer.
A default argument (C++ [dcl.fct.default]).
A use of a default initializer in a constructor or in aggregate initialization.
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Represents a list-initialization with parenthesis.
A rewritten comparison expression that was originally written using operator syntax.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Represents the body of a CapturedStmt, and serves as its DeclContext.
This captures a statement into a function.
Declaration of a class template.
Represents a class template specialization, which refers to a class template with a given set of temp...
Complex values, per C99 6.2.5p11.
Declaration of a C++20 concept.
A reference to a concept and its template args, as it appears in the code.
Represents the specialization of a concept - evaluates to a prvalue of type bool.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
bool hasExplicitTemplateArgs() const
const ImplicitConceptSpecializationDecl * getSpecializationDecl() const
A simple visitor class that helps create attribute visitors.
A simple visitor class that helps create declaration visitors.
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
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...
decl_range noload_decls() const
noload_decls_begin/end - Iterate over the declarations stored in this context that are currently load...
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Decl - This represents one declaration (or definition), e.g.
Represents the type decltype(expr) (C++11).
Expr * getUnderlyingExpr() const
A decomposition declaration.
Provides information about a dependent function-template specialization declaration.
Represents an array type in C++ whose size is a value-dependent expression.
Represents an extended vector type where either the type or size is dependent.
unsigned getNumArgs() const
TemplateArgumentLoc getArgLoc(unsigned i) const
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,...
An instance of this object exists for each enum constant that is defined.
This represents one expression.
Represents a member of a struct/union/class.
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Represents a function declaration or definition.
Represents a prototype with parameter type info, e.g.
ArrayRef< QualType > getParamTypes() const
Declaration of a template function.
Provides information about a function template specialization, which is a FunctionDecl that has been ...
ArrayRef< ParmVarDecl * > getParams() const
FunctionType - C99 6.7.5.3 - Function Declarators.
QualType getReturnType() const
Represents a C11 generic selection.
AssociationTy< true > ConstAssociation
ArrayRef< TemplateArgument > getTemplateArguments() const
Describes an C or C++ initializer list.
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
LabelStmt - Represents a label, which has a substatement.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Holds a QualType and a TypeSourceInfo* that came out of a declarator parsing.
Wrapper for source info for member pointers.
TypeSourceInfo * getClassTInfo() const
A pointer to member type per C++ 8.3.3 - Pointers to members.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
This represents '#pragma omp allocate ...' directive.
Pseudo declaration for capturing expressions.
This is a basic class for representing single OpenMP clause.
This represents '#pragma omp declare mapper ...' directive.
This represents '#pragma omp declare reduction ...' directive.
This is a basic class for representing single OpenMP executable directive.
This represents '#pragma omp threadprivate ...' directive.
Represents Objective-C's @catch statement.
ObjCCategoryDecl - Represents a category declaration.
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Represents an ObjC class declaration.
ObjCMethodDecl - Represents an instance or class method declaration.
Represents a pointer to an Objective C object.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
This is the base type for all OpenACC Clauses.
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Represents a partial function definition.
Represents a pack expansion of types.
Represents a parameter to a function.
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
bool hasQualifiers() const
Return true if the set contains any qualifiers.
Base for LValueReferenceType and RValueReferenceType.
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
SYCLKernelCallStmt represents the transformation that is applied to the body of a function declared w...
Represents an expression that computes the length of a parameter pack.
A trivial tuple used to represent a source range.
Represents a C++11 static_assert declaration.
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Stmt - This represents one statement.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Represents the result of substituting a set of types for a template type parameter pack.
Represents the result of substituting a type for a template type parameter.
A template argument list.
unsigned size() const
Retrieve the number of template arguments in this template argument list.
Location wrapper for a TemplateArgument.
const TemplateArgument & getArgument() const
SourceRange getSourceRange() const LLVM_READONLY
Represents a template argument.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
QualType getAsType() const
Retrieve the type for a type template argument.
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Stores a list of template parameters for a TemplateDecl and its derived classes.
Expr * getRequiresClause()
The constraint-expression of the associated requires-clause.
unsigned getNumArgs() const
TemplateArgumentLoc getArgLoc(unsigned i) const
Represents a type template specialization; the template must be a class template, a type alias templa...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Declaration of a template type parameter.
A declaration that models statements at global scope.
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Declaration of an alias template.
RetTy Visit(TypeLoc TyLoc)
Base wrapper for a particular "section" of type source info.
QualType getType() const
Get the type for which this source info wrapper provides information.
Expr * getUnderlyingExpr() const
Represents a typeof (or typeof) expression (a C23 feature and GCC extension) or a typeof_unqual expre...
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
RetTy Visit(const Type *T)
Performs the operation associated with this visitor object.
The base class of the type hierarchy.
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
A unary type transform, which is a type constructed from another.
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Represents a variable declaration or definition.
Declaration of a variable template.
Represents a variable template specialization, which refers to a variable template with a given set o...
Represents a C array with a specified size that is not an integer-constant-expression.
Represents a GCC generic vector type.
A static requirement that can be used in a requires-expression to check properties of types and expre...
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.
@ TK_AsIs
Will traverse all child nodes.
@ TK_IgnoreUnlessSpelledInSource
Ignore AST nodes not written in the source.
@ 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...
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
Represents an explicit template argument list in C++, e.g., the "" in "sort".
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
const Type * Ty
The locally-unqualified type.
Qualifiers Quals
The local qualifiers.