16#ifndef LLVM_CLANG_AST_DYNAMIC_RECURSIVE_AST_VISITOR_H
17#define LLVM_CLANG_AST_DYNAMIC_RECURSIVE_AST_VISITOR_H
226#define DEF_TRAVERSE_TMPL_INST(kind) \
227 virtual bool TraverseTemplateInstantiations(kind##TemplateDecl *D);
231#undef DEF_TRAVERSE_TMPL_INST
234#define ABSTRACT_DECL(DECL)
235#define DECL(CLASS, BASE) virtual bool Traverse##CLASS##Decl(CLASS##Decl *D);
236#include "clang/AST/DeclNodes.inc"
238#define DECL(CLASS, BASE) \
239 bool WalkUpFrom##CLASS##Decl(CLASS##Decl *D); \
240 virtual bool Visit##CLASS##Decl(CLASS##Decl *D) { return true; }
241#include "clang/AST/DeclNodes.inc"
244#define ABSTRACT_STMT(STMT)
245#define STMT(CLASS, PARENT) virtual bool Traverse##CLASS(CLASS *S);
246#include "clang/AST/StmtNodes.inc"
248#define STMT(CLASS, PARENT) \
249 bool WalkUpFrom##CLASS(CLASS *S); \
250 virtual bool Visit##CLASS(CLASS *S) { return true; }
251#include "clang/AST/StmtNodes.inc"
254#define ABSTRACT_TYPE(CLASS, BASE)
255#define TYPE(CLASS, BASE) virtual bool Traverse##CLASS##Type(CLASS##Type *T);
256#include "clang/AST/TypeNodes.inc"
258#define TYPE(CLASS, BASE) \
259 bool WalkUpFrom##CLASS##Type(CLASS##Type *T); \
260 virtual bool Visit##CLASS##Type(CLASS##Type *T) { return true; }
261#include "clang/AST/TypeNodes.inc"
264#define ABSTRACT_TYPELOC(CLASS, BASE)
265#define TYPELOC(CLASS, BASE) \
266 virtual bool Traverse##CLASS##TypeLoc(CLASS##TypeLoc TL);
267#include "clang/AST/TypeLocNodes.def"
269#define TYPELOC(CLASS, BASE) \
270 bool WalkUpFrom##CLASS##TypeLoc(CLASS##TypeLoc TL); \
271 virtual bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TL) { return true; }
272#include "clang/AST/TypeLocNodes.def"
#define DEF_TRAVERSE_TMPL_INST(kind)
Defines Expressions and AST nodes for C++2a concepts.
Defines the clang::TypeLoc interface and its subclasses.
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 ~DynamicRecursiveASTVisitor()=default
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...
DynamicRecursiveASTVisitor()=default
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.
DynamicRecursiveASTVisitor & operator=(DynamicRecursiveASTVisitor &&)=default
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)
bool WalkUpFromStmt(Stmt *S)
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)
bool WalkUpFromType(Type *T)
virtual bool TraverseTemplateArgument(const TemplateArgument &Arg)
Recursively visit a template argument and dispatch to the appropriate method for the argument type.
bool WalkUpFromDecl(Decl *D)
Walk up from a node.
DynamicRecursiveASTVisitor(const DynamicRecursiveASTVisitor &)=default
virtual bool TraverseConstructorInitializer(CXXCtorInitializer *Init)
Recursively visit a constructor initializer.
bool TraverseTemplateArguments(ArrayRef< TemplateArgument > Args)
Recursively visit a set of template arguments.
DynamicRecursiveASTVisitor & operator=(const DynamicRecursiveASTVisitor &)=default
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)
DynamicRecursiveASTVisitor(DynamicRecursiveASTVisitor &&)=default
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.
bool WalkUpFromTypeLoc(TypeLoc TL)
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.
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...