97 return Visitor.ShouldVisitTemplateInstantiations;
101 return Visitor.ShouldWalkTypesOfTypeLocs;
105 return Visitor.ShouldVisitImplicitCode;
119 return Visitor.TraverseType(
T, TraverseQualifier);
122 return Visitor.TraverseTypeLoc(TL, TraverseQualifier);
127 return Visitor.TraverseConstructorInitializer(
Init);
131 return Visitor.TraverseTemplateArgument(Arg);
135 return Visitor.TraverseTemplateArgumentLoc(ArgLoc);
139 return Visitor.TraverseTemplateName(
Template);
143 return Visitor.TraverseObjCProtocolLoc(ProtocolLoc);
147 return Visitor.TraverseTypeConstraint(
C);
150 return Visitor.TraverseConceptRequirement(R);
153 return Visitor.TraverseConceptTypeRequirement(R);
156 return Visitor.TraverseConceptExprRequirement(R);
159 return Visitor.TraverseConceptNestedRequirement(R);
163 return Visitor.TraverseConceptReference(CR);
167 return Visitor.TraverseCXXBaseSpecifier(
Base);
171 return Visitor.TraverseDeclarationNameInfo(NameInfo);
176 return Visitor.TraverseLambdaCapture(LE,
C,
Init);
180 return Visitor.TraverseNestedNameSpecifier(NNS);
184 return Visitor.TraverseNestedNameSpecifierLoc(NNS);
188 return Visitor.VisitConceptReference(CR);
202 return Visitor.dataTraverseNode(S);
212#define DEF_TRAVERSE_TMPL_INST(kind) \
213 bool TraverseTemplateInstantiations(kind##TemplateDecl *D) { \
214 return Visitor.TraverseTemplateInstantiations(D); \
219#undef DEF_TRAVERSE_TMPL_INST
222#define ABSTRACT_DECL(DECL)
223#define DECL(CLASS, BASE) \
224 bool Traverse##CLASS##Decl(CLASS##Decl *D) { \
225 return Visitor.Traverse##CLASS##Decl(D); \
227#include "clang/AST/DeclNodes.inc"
229#define DECL(CLASS, BASE) \
230 bool Visit##CLASS##Decl(CLASS##Decl *D) { \
231 return Visitor.Visit##CLASS##Decl(D); \
233#include "clang/AST/DeclNodes.inc"
236#define ABSTRACT_STMT(STMT)
237#define STMT(CLASS, PARENT) \
238 bool Traverse##CLASS(CLASS *S) { return Visitor.Traverse##CLASS(S); }
239#include "clang/AST/StmtNodes.inc"
241#define STMT(CLASS, PARENT) \
242 bool Visit##CLASS(CLASS *S) { return Visitor.Visit##CLASS(S); }
243#include "clang/AST/StmtNodes.inc"
246#define ABSTRACT_TYPE(CLASS, BASE)
247#define TYPE(CLASS, BASE) \
248 bool Traverse##CLASS##Type(CLASS##Type *T, bool TraverseQualifier) { \
249 return Visitor.Traverse##CLASS##Type(T, TraverseQualifier); \
251#include "clang/AST/TypeNodes.inc"
253#define TYPE(CLASS, BASE) \
254 bool Visit##CLASS##Type(CLASS##Type *T) { \
255 return Visitor.Visit##CLASS##Type(T); \
257#include "clang/AST/TypeNodes.inc"
260#define ABSTRACT_TYPELOC(CLASS, BASE)
261#define TYPELOC(CLASS, BASE) \
262 bool Traverse##CLASS##TypeLoc(CLASS##TypeLoc TL, bool TraverseQualifier) { \
263 return Visitor.Traverse##CLASS##TypeLoc(TL, TraverseQualifier); \
265#include "clang/AST/TypeLocNodes.def"
267#define TYPELOC(CLASS, BASE) \
268 bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TL) { \
269 return Visitor.Visit##CLASS##TypeLoc(TL); \
271#include "clang/AST/TypeLocNodes.def"
283#define FORWARD_TO_BASE(Function, Type, RefOrPointer) \
284 template <bool Const> \
285 bool DynamicRecursiveASTVisitorBase<Const>::Function( \
286 MaybeConst<Type> RefOrPointer Param) { \
287 return Impl<Const>(*this).RecursiveASTVisitor<Impl<Const>>::Function( \
288 const_cast<Type RefOrPointer>(Param)); \
292#define FORWARD_TO_BASE_EXACT(Function, Type) \
293 template <bool Const> \
294 bool DynamicRecursiveASTVisitorBase<Const>::Function(Type Param) { \
295 return Impl<Const>(*this).RecursiveASTVisitor<Impl<Const>>::Function( \
308FORWARD_TO_BASE(TraverseConceptTypeRequirement, concepts::TypeRequirement, *)
309FORWARD_TO_BASE(TraverseConceptExprRequirement, concepts::ExprRequirement, *)
312 concepts::NestedRequirement, *)
325 return Impl<Const>(*this).RecursiveASTVisitor<Impl<Const>>::TraverseType(
326 T, TraverseQualifier);
331 TypeLoc TL,
bool TraverseQualifier) {
332 return Impl<Const>(*this).RecursiveASTVisitor<Impl<Const>>::TraverseTypeLoc(
333 TL, TraverseQualifier);
344 return Impl<Const>(*
this)
345 .RecursiveASTVisitor<Impl<Const>>::TraverseLambdaCapture(
352 return Impl<Const>(*this).RecursiveASTVisitor<Impl<Const>>::dataTraverseNode(
353 const_cast<Stmt *
>(S),
nullptr);
357#define ABSTRACT_DECL(DECL)
358#define DECL(CLASS, BASE) \
359 FORWARD_TO_BASE(Traverse##CLASS##Decl, CLASS##Decl, *) \
360 FORWARD_TO_BASE(WalkUpFrom##CLASS##Decl, CLASS##Decl, *)
361#include "clang/AST/DeclNodes.inc"
364#define ABSTRACT_STMT(STMT)
365#define STMT(CLASS, PARENT) FORWARD_TO_BASE(Traverse##CLASS, CLASS, *)
366#include "clang/AST/StmtNodes.inc"
368#define STMT(CLASS, PARENT) FORWARD_TO_BASE(WalkUpFrom##CLASS, CLASS, *)
369#include "clang/AST/StmtNodes.inc"
372#define ABSTRACT_TYPE(CLASS, BASE)
373#define TYPE(CLASS, BASE) \
374 template <bool Const> \
375 bool DynamicRecursiveASTVisitorBase<Const>::Traverse##CLASS##Type( \
376 MaybeConst<CLASS##Type> *T, bool TraverseQualifier) { \
377 return Impl<Const>(*this) \
378 .RecursiveASTVisitor<Impl<Const>>::Traverse##CLASS##Type( \
379 const_cast<CLASS##Type *>(T), TraverseQualifier); \
381 FORWARD_TO_BASE(WalkUpFrom##CLASS##Type, CLASS##Type, *)
382#include "clang/AST/TypeNodes.inc"
384#define ABSTRACT_TYPELOC(CLASS, BASE)
385#define TYPELOC(CLASS, BASE) \
386 template <bool Const> \
387 bool DynamicRecursiveASTVisitorBase<Const>::Traverse##CLASS##TypeLoc( \
388 CLASS##TypeLoc TL, bool TraverseQualifier) { \
389 return Impl<Const>(*this) \
390 .RecursiveASTVisitor<Impl<Const>>::Traverse##CLASS##TypeLoc( \
391 TL, TraverseQualifier); \
393#include "clang/AST/TypeLocNodes.def"
395#define TYPELOC(CLASS, BASE) \
396 FORWARD_TO_BASE_EXACT(WalkUpFrom##CLASS##TypeLoc, CLASS##TypeLoc)
397#include "clang/AST/TypeLocNodes.def"
#define FORWARD_TO_BASE_EXACT(Function, Type)
#define FORWARD_TO_BASE(Function, Type, RefOrPointer)
#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.
Declaration of a class template.
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.
std::conditional_t< IsConst, const ASTNode, ASTNode > MaybeConst
virtual bool TraverseTypeLoc(TypeLoc TL, bool TraverseQualifier=true)
Recursively visit a type with location, by dispatching to Traverse*TypeLoc() based on the argument ty...
virtual bool TraverseLambdaCapture(MaybeConst< LambdaExpr > *LE, const LambdaCapture *C, MaybeConst< Expr > *Init)
Recursively visit a lambda capture.
virtual bool dataTraverseNode(MaybeConst< Stmt > *S)
This represents one expression.
Declaration of a template function.
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 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 TraverseNestedNameSpecifier(NestedNameSpecifier NNS)
Recursively visit a C++ nested-name-specifier.
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 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 TraverseTypeLoc(TypeLoc TL, bool TraverseQualifier=true)
Recursively visit a type with location, by dispatching to Traverse*TypeLoc() based on the argument ty...
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 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 TraverseType(QualType T, bool TraverseQualifier=true)
Recursively visit a type, by dispatching to Traverse*Type() based on the argument's getTypeClass() pr...
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.
Declaration of a variable template.
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.
@ Template
We are parsing a template declaration.
const FunctionProtoType * T
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...