206#define DEF_TRAVERSE_TMPL_INST(kind) \
207 bool TraverseTemplateInstantiations(kind##TemplateDecl *D) { \
208 return Visitor.TraverseTemplateInstantiations(D); \
213#undef DEF_TRAVERSE_TMPL_INST
216#define ABSTRACT_DECL(DECL)
217#define DECL(CLASS, BASE) \
218 bool Traverse##CLASS##Decl(CLASS##Decl *D) { \
219 return Visitor.Traverse##CLASS##Decl(D); \
221#include "clang/AST/DeclNodes.inc"
223#define DECL(CLASS, BASE) \
224 bool Visit##CLASS##Decl(CLASS##Decl *D) { \
225 return Visitor.Visit##CLASS##Decl(D); \
227#include "clang/AST/DeclNodes.inc"
230#define ABSTRACT_STMT(STMT)
231#define STMT(CLASS, PARENT) \
232 bool Traverse##CLASS(CLASS *S) { return Visitor.Traverse##CLASS(S); }
233#include "clang/AST/StmtNodes.inc"
235#define STMT(CLASS, PARENT) \
236 bool Visit##CLASS(CLASS *S) { return Visitor.Visit##CLASS(S); }
237#include "clang/AST/StmtNodes.inc"
240#define ABSTRACT_TYPE(CLASS, BASE)
241#define TYPE(CLASS, BASE) \
242 bool Traverse##CLASS##Type(CLASS##Type *T) { \
243 return Visitor.Traverse##CLASS##Type(T); \
245#include "clang/AST/TypeNodes.inc"
247#define TYPE(CLASS, BASE) \
248 bool Visit##CLASS##Type(CLASS##Type *T) { \
249 return Visitor.Visit##CLASS##Type(T); \
251#include "clang/AST/TypeNodes.inc"
254#define ABSTRACT_TYPELOC(CLASS, BASE)
255#define TYPELOC(CLASS, BASE) \
256 bool Traverse##CLASS##TypeLoc(CLASS##TypeLoc TL) { \
257 return Visitor.Traverse##CLASS##TypeLoc(TL); \
259#include "clang/AST/TypeLocNodes.def"
261#define TYPELOC(CLASS, BASE) \
262 bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TL) { \
263 return Visitor.Visit##CLASS##TypeLoc(TL); \
265#include "clang/AST/TypeLocNodes.def"
272 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseAST(AST);
276 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseAttr(At);
281 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseConstructorInitializer(
286 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseDecl(
D);
292 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseLambdaCapture(LE,
C,
297 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseStmt(S);
302 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseTemplateArgument(Arg);
307 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseTemplateArguments(Args);
312 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseTemplateArgumentLoc(
317 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseTemplateName(Template);
321 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseType(
T);
325 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseTypeLoc(TL);
330 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseTypeConstraint(
C);
334 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseObjCProtocolLoc(
340 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseConceptRequirement(R);
344 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseConceptTypeRequirement(
349 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseConceptExprRequirement(
355 .RecursiveASTVisitor<Impl>::TraverseConceptNestedRequirement(R);
360 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseConceptReference(CR);
365 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseCXXBaseSpecifier(
Base);
370 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseDeclarationNameInfo(
376 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseNestedNameSpecifier(
382 return Impl(*this).RecursiveASTVisitor<Impl>::TraverseNestedNameSpecifierLoc(
387 return Impl(*this).RecursiveASTVisitor<Impl>::dataTraverseNode(S,
nullptr);
390#define DEF_TRAVERSE_TMPL_INST(kind) \
391 bool DynamicRecursiveASTVisitor::TraverseTemplateInstantiations( \
392 kind##TemplateDecl *D) { \
394 .RecursiveASTVisitor<Impl>::TraverseTemplateInstantiations(D); \
399#undef DEF_TRAVERSE_TMPL_INST
402#define ABSTRACT_DECL(DECL)
403#define DECL(CLASS, BASE) \
404 bool DynamicRecursiveASTVisitor::Traverse##CLASS##Decl(CLASS##Decl *D) { \
405 return Impl(*this).RecursiveASTVisitor<Impl>::Traverse##CLASS##Decl(D); \
407 bool DynamicRecursiveASTVisitor::WalkUpFrom##CLASS##Decl(CLASS##Decl *D) { \
408 return Impl(*this).RecursiveASTVisitor<Impl>::WalkUpFrom##CLASS##Decl(D); \
410#include "clang/AST/DeclNodes.inc"
413#define ABSTRACT_STMT(STMT)
414#define STMT(CLASS, PARENT) \
415 bool DynamicRecursiveASTVisitor::Traverse##CLASS(CLASS *S) { \
416 return Impl(*this).RecursiveASTVisitor<Impl>::Traverse##CLASS(S); \
418#include "clang/AST/StmtNodes.inc"
420#define STMT(CLASS, PARENT) \
421 bool DynamicRecursiveASTVisitor::WalkUpFrom##CLASS(CLASS *S) { \
422 return Impl(*this).RecursiveASTVisitor<Impl>::WalkUpFrom##CLASS(S); \
424#include "clang/AST/StmtNodes.inc"
427#define ABSTRACT_TYPE(CLASS, BASE)
428#define TYPE(CLASS, BASE) \
429 bool DynamicRecursiveASTVisitor::Traverse##CLASS##Type(CLASS##Type *T) { \
430 return Impl(*this).RecursiveASTVisitor<Impl>::Traverse##CLASS##Type(T); \
432 bool DynamicRecursiveASTVisitor::WalkUpFrom##CLASS##Type(CLASS##Type *T) { \
433 return Impl(*this).RecursiveASTVisitor<Impl>::WalkUpFrom##CLASS##Type(T); \
435#include "clang/AST/TypeNodes.inc"
437#define ABSTRACT_TYPELOC(CLASS, BASE)
438#define TYPELOC(CLASS, BASE) \
439 bool DynamicRecursiveASTVisitor::Traverse##CLASS##TypeLoc( \
440 CLASS##TypeLoc TL) { \
441 return Impl(*this).RecursiveASTVisitor<Impl>::Traverse##CLASS##TypeLoc( \
444#include "clang/AST/TypeLocNodes.def"
446#define TYPELOC(CLASS, BASE) \
447 bool DynamicRecursiveASTVisitor::WalkUpFrom##CLASS##TypeLoc( \
448 CLASS##TypeLoc TL) { \
449 return Impl(*this).RecursiveASTVisitor<Impl>::WalkUpFrom##CLASS##TypeLoc( \
452#include "clang/AST/TypeLocNodes.def"
#define DEF_TRAVERSE_TMPL_INST(kind)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Attr - This represents one attribute.
Represents a base class of a C++ class.
Represents a C++ base or member initializer.
A reference to a concept and its template args, as it appears in the code.
Decl - This represents one declaration (or definition), e.g.
Recursive AST visitor that supports extension via dynamic dispatch.
virtual bool TraverseDeclarationNameInfo(DeclarationNameInfo NameInfo)
Recursively visit a name with its location information.
virtual bool dataTraverseStmtPost(Stmt *S)
Invoked after visiting a statement or expression via data recursion.
virtual bool TraverseDecl(Decl *D)
Recursively visit a declaration, by dispatching to Traverse*Decl() based on the argument's dynamic ty...
virtual bool TraverseConceptTypeRequirement(concepts::TypeRequirement *R)
virtual bool TraverseNestedNameSpecifier(NestedNameSpecifier *NNS)
Recursively visit a C++ nested-name-specifier.
virtual bool VisitAttr(Attr *A)
Visit a node.
bool ShouldVisitLambdaBody
Whether this visitor should recurse into lambda body.
virtual bool TraverseTypeLoc(TypeLoc TL)
Recursively visit a type with location, by dispatching to Traverse*TypeLoc() based on the argument ty...
virtual bool dataTraverseStmtPre(Stmt *S)
Invoked before visiting a statement or expression via data recursion.
virtual bool TraverseConceptRequirement(concepts::Requirement *R)
virtual bool TraverseObjCProtocolLoc(ObjCProtocolLoc ProtocolLoc)
Recursively visit an Objective-C protocol reference with location information.
virtual bool VisitConceptReference(ConceptReference *CR)
virtual bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Recursively visit a C++ nested-name-specifier with location information.
virtual bool VisitStmt(Stmt *S)
virtual bool TraverseLambdaCapture(LambdaExpr *LE, const LambdaCapture *C, Expr *Init)
Recursively visit a lambda capture.
virtual bool VisitType(Type *T)
virtual bool TraverseAttr(Attr *At)
Recursively visit an attribute, by dispatching to Traverse*Attr() based on the argument's dynamic typ...
virtual bool TraverseStmt(Stmt *S)
Recursively visit a statement or expression, by dispatching to Traverse*() based on the argument's dy...
virtual bool TraverseConceptReference(ConceptReference *CR)
virtual bool VisitDecl(Decl *D)
virtual bool TraverseTemplateArgument(const TemplateArgument &Arg)
Recursively visit a template argument and dispatch to the appropriate method for the argument type.
virtual bool TraverseConstructorInitializer(CXXCtorInitializer *Init)
Recursively visit a constructor initializer.
bool TraverseTemplateArguments(ArrayRef< TemplateArgument > Args)
Recursively visit a set of template arguments.
virtual bool TraverseConceptExprRequirement(concepts::ExprRequirement *R)
virtual bool TraverseTemplateArgumentLoc(const TemplateArgumentLoc &ArgLoc)
Recursively visit a template argument location and dispatch to the appropriate method for the argumen...
virtual bool dataTraverseNode(Stmt *S)
virtual bool TraverseAST(ASTContext &AST)
Recursively visits an entire AST, starting from the TranslationUnitDecl.
virtual bool TraverseType(QualType T)
Recursively visit a type, by dispatching to Traverse*Type() based on the argument's getTypeClass() pr...
virtual bool TraverseCXXBaseSpecifier(const CXXBaseSpecifier &Base)
Recursively visit a base specifier.
virtual bool TraverseTypeConstraint(const TypeConstraint *C)
Traverse a concept (requirement).
bool ShouldWalkTypesOfTypeLocs
Whether this visitor should recurse into the types of TypeLocs.
bool ShouldVisitImplicitCode
Whether this visitor should recurse into implicit code, e.g.
virtual bool TraverseConceptNestedRequirement(concepts::NestedRequirement *R)
virtual bool VisitTypeLoc(TypeLoc TL)
bool ShouldVisitTemplateInstantiations
Whether this visitor should recurse into template instantiations.
virtual bool TraverseTemplateName(TemplateName Template)
Recursively visit a template name and dispatch to the appropriate method.
This represents one expression.
Describes the capture of a variable or of this, or of a C++1y init-capture.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
A C++ nested-name-specifier augmented with source location information.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
A (possibly-)qualified type.
A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each...
bool TraverseStmt(Stmt *S, DataRecursionQueue *Queue=nullptr)
Recursively visit a statement or expression, by dispatching to Traverse*() based on the argument's dy...
bool TraverseTemplateArgument(const TemplateArgument &Arg)
Recursively visit a template argument and dispatch to the appropriate method for the argument type.
bool TraverseConceptRequirement(concepts::Requirement *R)
bool TraverseType(QualType T)
Recursively visit a type, by dispatching to Traverse*Type() based on the argument's getTypeClass() pr...
bool dataTraverseStmtPre(Stmt *S)
Invoked before visiting a statement or expression via data recursion.
bool TraverseObjCProtocolLoc(ObjCProtocolLoc ProtocolLoc)
Recursively visit an Objective-C protocol reference with location information.
bool TraverseConceptExprRequirement(concepts::ExprRequirement *R)
bool TraverseAST(ASTContext &AST)
Recursively visits an entire AST, starting from the TranslationUnitDecl.
bool shouldVisitTemplateInstantiations() const
Return whether this visitor should recurse into template instantiations.
bool TraverseTemplateArgumentLoc(const TemplateArgumentLoc &ArgLoc)
Recursively visit a template argument location and dispatch to the appropriate method for the argumen...
bool dataTraverseStmtPost(Stmt *S)
Invoked after visiting a statement or expression via data recursion.
bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Recursively visit a C++ nested-name-specifier with location information.
bool TraverseTemplateName(TemplateName Template)
Recursively visit a template name and dispatch to the appropriate method.
bool TraverseNestedNameSpecifier(NestedNameSpecifier *NNS)
Recursively visit a C++ nested-name-specifier.
bool shouldVisitImplicitCode() const
Return whether this visitor should recurse into implicit code, e.g., implicit constructors and destru...
bool TraverseConceptReference(ConceptReference *CR)
Recursively visit concept reference with location information.
bool dataTraverseNode(Stmt *S, DataRecursionQueue *Queue)
bool TraverseDecl(Decl *D)
Recursively visit a declaration, by dispatching to Traverse*Decl() based on the argument's dynamic ty...
bool TraverseTypeLoc(TypeLoc TL)
Recursively visit a type with location, by dispatching to Traverse*TypeLoc() based on the argument ty...
bool TraverseTypeConstraint(const TypeConstraint *C)
bool VisitTypeLoc(TypeLoc TL)
bool TraverseLambdaCapture(LambdaExpr *LE, const LambdaCapture *C, Expr *Init)
Recursively visit a lambda capture.
bool VisitConceptReference(ConceptReference *CR)
bool shouldTraversePostOrder() const
Return whether this visitor should traverse post-order.
bool shouldVisitLambdaBody() const
Return whether this visitor should recurse into lambda body.
bool TraverseAttr(Attr *At)
Recursively visit an attribute, by dispatching to Traverse*Attr() based on the argument's dynamic typ...
bool TraverseConceptNestedRequirement(concepts::NestedRequirement *R)
bool shouldWalkTypesOfTypeLocs() const
Return whether this visitor should recurse into the types of TypeLocs.
bool TraverseDeclarationNameInfo(DeclarationNameInfo NameInfo)
Recursively visit a name with its location information.
bool TraverseCXXBaseSpecifier(const CXXBaseSpecifier &Base)
Recursively visit a base specifier.
bool TraverseConceptTypeRequirement(concepts::TypeRequirement *R)
bool TraverseConstructorInitializer(CXXCtorInitializer *Init)
Recursively visit a constructor initializer.
Stmt - This represents one statement.
Location wrapper for a TemplateArgument.
Represents a template argument.
Represents a C++ template name within the type system.
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string...
Base wrapper for a particular "section" of type source info.
The base class of the type hierarchy.
A requires-expression requirement which queries the validity and properties of an expression ('simple...
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...
A static requirement that can be used in a requires-expression to check properties of types and expre...
A requires-expression requirement which queries the existence of a type name or type template special...
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
@ Class
The "class" keyword introduces the elaborated-type-specifier.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...