clang  6.0.0svn
Classes | Namespaces | Macros | Functions | Variables
RecursiveASTVisitor.h File Reference
#include "clang/AST/Attr.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclFriend.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclOpenMP.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/ExprOpenMP.h"
#include "clang/AST/LambdaCapture.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/OpenMPClause.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtObjC.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/AST/TemplateBase.h"
#include "clang/AST/TemplateName.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/Specifiers.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Casting.h"
#include <algorithm>
#include <cstddef>
#include <type_traits>
#include "clang/AST/AttrVisitor.inc"
#include "clang/AST/StmtNodes.inc"
#include "clang/AST/TypeNodes.def"
#include "clang/AST/TypeLocNodes.def"
#include "clang/AST/DeclNodes.inc"
#include "clang/Basic/OpenMPKinds.def"
Include dependency graph for RecursiveASTVisitor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  clang::RecursiveASTVisitor< Derived >
 A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each node. More...
 

Namespaces

 clang
 Dataflow Directional Tag Classes.
 

Macros

#define UNARYOP_LIST()
 
#define BINOP_LIST()
 
#define CAO_LIST()
 
#define TRY_TO(CALL_EXPR)
 
#define ATTR_VISITOR_DECLS_ONLY
 
#define TRAVERSE_STMT_BASE(NAME, CLASS, VAR, QUEUE)
 
#define TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S)
 
#define ABSTRACT_STMT(STMT)
 
#define STMT(CLASS, PARENT)   bool Traverse##CLASS(CLASS *S, DataRecursionQueue *Queue = nullptr);
 
#define STMT(CLASS, PARENT)
 
#define OPERATOR(NAME)
 
#define GENERAL_BINOP_FALLBACK(NAME, BINOP_TYPE)
 
#define OPERATOR(NAME)   GENERAL_BINOP_FALLBACK(NAME, BinaryOperator)
 
#define OPERATOR(NAME)   GENERAL_BINOP_FALLBACK(NAME##Assign, CompoundAssignOperator)
 
#define ABSTRACT_TYPE(CLASS, BASE)
 
#define TYPE(CLASS, BASE)   bool Traverse##CLASS##Type(CLASS##Type *T);
 
#define TYPE(CLASS, BASE)
 
#define ABSTRACT_TYPELOC(CLASS, BASE)
 
#define TYPELOC(CLASS, BASE)   bool Traverse##CLASS##TypeLoc(CLASS##TypeLoc TL);
 
#define TYPE(CLASS, BASE)
 
#define ABSTRACT_DECL(DECL)
 
#define DECL(CLASS, BASE)   bool Traverse##CLASS##Decl(CLASS##Decl *D);
 
#define DECL(CLASS, BASE)
 
#define DEF_TRAVERSE_TMPL_INST(TMPLDECLKIND)   bool TraverseTemplateInstantiations(TMPLDECLKIND##TemplateDecl *D);
 
#define OPENMP_CLAUSE(Name, Class)   bool Visit##Class(Class *C);
 
#define DISPATCH_STMT(NAME, CLASS, VAR)   return TRAVERSE_STMT_BASE(NAME, CLASS, VAR, Queue);
 
#define OPERATOR(NAME)
 
#define OPERATOR(NAME)
 
#define OPERATOR(NAME)
 
#define ABSTRACT_STMT(STMT)
 
#define STMT(CLASS, PARENT)
 
#define ABSTRACT_STMT(STMT)
 
#define STMT(CLASS, PARENT)
 
#define INITLISTEXPR(CLASS, PARENT)
 
#define DISPATCH(NAME, CLASS, VAR)   return getDerived().Traverse##NAME(static_cast<CLASS *>(VAR))
 
#define ABSTRACT_TYPE(CLASS, BASE)
 
#define TYPE(CLASS, BASE)
 
#define ABSTRACT_TYPELOC(CLASS, BASE)
 
#define TYPELOC(CLASS, BASE)
 
#define VISITORCLASS   RecursiveASTVisitor
 
#define ABSTRACT_DECL(DECL)
 
#define DECL(CLASS, BASE)
 
#define DEF_TRAVERSE_TYPE(TYPE, CODE)
 
#define DEF_TRAVERSE_TYPELOC(TYPE, CODE)
 
#define DEF_TRAVERSE_DECL(DECL, CODE)
 
#define DEF_TRAVERSE_TMPL_DECL(TMPLDECLKIND)
 
#define DEF_TRAVERSE_TMPL_SPEC_DECL(TMPLDECLKIND)
 
#define DEF_TRAVERSE_TMPL_PART_SPEC_DECL(TMPLDECLKIND, DECLKIND)
 
#define DEF_TRAVERSE_STMT(STMT, CODE)
 
#define OPENMP_CLAUSE(Name, Class)
 

Functions

 clang::DEF_TRAVERSE_TYPE (ComplexType, { TRY_TO(TraverseType(T->getElementType()));}) DEF_TRAVERSE_TYPE(PointerType
 
 clang::DEF_TRAVERSE_TYPE (BlockPointerType, { TRY_TO(TraverseType(T->getPointeeType()));}) DEF_TRAVERSE_TYPE(LValueReferenceType
 
 clang::DEF_TRAVERSE_TYPE (RValueReferenceType, { TRY_TO(TraverseType(T->getPointeeType()));}) DEF_TRAVERSE_TYPE(MemberPointerType
 
 clang::TRY_TO (TraverseType(T->getPointeeType()))
 
 clang::DEF_TRAVERSE_TYPE (AdjustedType, { TRY_TO(TraverseType(T->getOriginalType()));}) DEF_TRAVERSE_TYPE(DecayedType
 
 clang::DEF_TRAVERSE_TYPE (ConstantArrayType, { TRY_TO(TraverseType(T->getElementType()));}) DEF_TRAVERSE_TYPE(IncompleteArrayType
 
 clang::DEF_TRAVERSE_TYPE (VariableArrayType, { TRY_TO(TraverseType(T->getElementType()));TRY_TO(TraverseStmt(T->getSizeExpr()));}) DEF_TRAVERSE_TYPE(DependentSizedArrayType
 
 clang::if (T->getSizeExpr()) TRY_TO(TraverseStmt(T -> getSizeExpr()))
 
 clang::DEF_TRAVERSE_TYPE (DependentAddressSpaceType, { TRY_TO(TraverseStmt(T->getAddrSpaceExpr()));TRY_TO(TraverseType(T->getPointeeType()));}) DEF_TRAVERSE_TYPE(DependentSizedExtVectorType
 
 clang::TRY_TO (TraverseType(T->getElementType()))
 
 clang::DEF_TRAVERSE_TYPE (VectorType, { TRY_TO(TraverseType(T->getElementType()));}) DEF_TRAVERSE_TYPE(ExtVectorType
 
 clang::DEF_TRAVERSE_TYPE (FunctionNoProtoType, { TRY_TO(TraverseType(T->getReturnType()));}) DEF_TRAVERSE_TYPE(FunctionProtoType
 
 clang::for (const auto &A :T->param_types())
 
 clang::for (const auto &E :T->exceptions())
 
 clang::if (Expr *NE=T->getNoexceptExpr()) TRY_TO(TraverseStmt(NE))
 
 clang::DEF_TRAVERSE_TYPE (TypeOfExprType, { TRY_TO(TraverseStmt(T->getUnderlyingExpr()));}) DEF_TRAVERSE_TYPE(TypeOfType
 
 clang::DEF_TRAVERSE_TYPE (DecltypeType, { TRY_TO(TraverseStmt(T->getUnderlyingExpr()));}) DEF_TRAVERSE_TYPE(UnaryTransformType
 
 clang::TRY_TO (TraverseType(T->getUnderlyingType()))
 
 clang::DEF_TRAVERSE_TYPE (AutoType, { TRY_TO(TraverseType(T->getDeducedType()));}) DEF_TRAVERSE_TYPE(DeducedTemplateSpecializationType
 
 clang::TRY_TO (TraverseType(T->getDeducedType()))
 
 clang::DEF_TRAVERSE_TYPE (SubstTemplateTypeParmType, { TRY_TO(TraverseType(T->getReplacementType()));}) DEF_TRAVERSE_TYPE(SubstTemplateTypeParmPackType
 
 clang::DEF_TRAVERSE_TYPE (TemplateSpecializationType, { TRY_TO(TraverseTemplateName(T->getTemplateName()));TRY_TO(TraverseTemplateArguments(T->getArgs(), T->getNumArgs()));}) DEF_TRAVERSE_TYPE(AttributedType
 
 clang::DEF_TRAVERSE_TYPE (ParenType, { TRY_TO(TraverseType(T->getInnerType()));}) DEF_TRAVERSE_TYPE(ElaboratedType
 
 clang::DEF_TRAVERSE_TYPE (DependentNameType, { TRY_TO(TraverseNestedNameSpecifier(T->getQualifier()));}) DEF_TRAVERSE_TYPE(DependentTemplateSpecializationType
 
 clang::TRY_TO (TraverseTemplateArguments(T->getArgs(), T->getNumArgs()))
 
 clang::DEF_TRAVERSE_TYPE (PackExpansionType, { TRY_TO(TraverseType(T->getPattern()));}) DEF_TRAVERSE_TYPE(ObjCObjectType
 
 clang::for (auto typeArg :T->getTypeArgsAsWritten())
 
 clang::DEF_TRAVERSE_TYPE (ObjCObjectPointerType, { TRY_TO(TraverseType(T->getPointeeType()));}) DEF_TRAVERSE_TYPE(AtomicType
 
 clang::DEF_TRAVERSE_TYPE (PipeType, { TRY_TO(TraverseType(T->getElementType()));}) template< typename Derived > bool RecursiveASTVisitor< Derived >
 
 clang::DEF_TRAVERSE_TYPELOC (ComplexType, { TRY_TO(TraverseType(TL.getTypePtr() ->getElementType()));}) DEF_TRAVERSE_TYPELOC(PointerType
 
 clang::DEF_TRAVERSE_TYPELOC (BlockPointerType, { TRY_TO(TraverseTypeLoc(TL.getPointeeLoc()));}) DEF_TRAVERSE_TYPELOC(LValueReferenceType
 
 clang::DEF_TRAVERSE_TYPELOC (RValueReferenceType, { TRY_TO(TraverseTypeLoc(TL.getPointeeLoc()));}) DEF_TRAVERSE_TYPELOC(MemberPointerType
 
 clang::TRY_TO (TraverseTypeLoc(TL.getPointeeLoc()))
 
 clang::DEF_TRAVERSE_TYPELOC (AdjustedType, { TRY_TO(TraverseTypeLoc(TL.getOriginalLoc()));}) DEF_TRAVERSE_TYPELOC(DecayedType
 
 clang::DEF_TRAVERSE_TYPELOC (ConstantArrayType, { TRY_TO(TraverseTypeLoc(TL.getElementLoc()));return TraverseArrayTypeLocHelper(TL);}) DEF_TRAVERSE_TYPELOC(IncompleteArrayType
 
return clang::TraverseArrayTypeLocHelper (TL)
 
 clang::DEF_TRAVERSE_TYPELOC (VariableArrayType, { TRY_TO(TraverseTypeLoc(TL.getElementLoc()));return TraverseArrayTypeLocHelper(TL);}) DEF_TRAVERSE_TYPELOC(DependentSizedArrayType
 
 clang::DEF_TRAVERSE_TYPELOC (DependentAddressSpaceType, { TRY_TO(TraverseStmt(TL.getTypePtr() ->getAddrSpaceExpr()));TRY_TO(TraverseType(TL.getTypePtr() ->getPointeeType()));}) DEF_TRAVERSE_TYPELOC(DependentSizedExtVectorType
 
 clang::TRY_TO (TraverseType(TL.getTypePtr() ->getElementType()))
 
 clang::DEF_TRAVERSE_TYPELOC (VectorType, { TRY_TO(TraverseType(TL.getTypePtr() ->getElementType()));}) DEF_TRAVERSE_TYPELOC(ExtVectorType
 
 clang::DEF_TRAVERSE_TYPELOC (FunctionNoProtoType, { TRY_TO(TraverseTypeLoc(TL.getReturnLoc()));}) DEF_TRAVERSE_TYPELOC(FunctionProtoType
 
 clang::for (unsigned I=0, E=TL.getNumParams();I !=E;++I)
 
 clang::DEF_TRAVERSE_TYPELOC (TypeOfExprType, { TRY_TO(TraverseStmt(TL.getUnderlyingExpr()));}) DEF_TRAVERSE_TYPELOC(TypeOfType
 
 clang::DEF_TRAVERSE_TYPELOC (DecltypeType, { TRY_TO(TraverseStmt(TL.getTypePtr() ->getUnderlyingExpr()));}) DEF_TRAVERSE_TYPELOC(UnaryTransformType
 
 clang::DEF_TRAVERSE_TYPELOC (AutoType, { TRY_TO(TraverseType(TL.getTypePtr() ->getDeducedType()));}) DEF_TRAVERSE_TYPELOC(DeducedTemplateSpecializationType
 
 clang::TRY_TO (TraverseType(TL.getTypePtr() ->getDeducedType()))
 
 clang::DEF_TRAVERSE_TYPELOC (SubstTemplateTypeParmType, { TRY_TO(TraverseType(TL.getTypePtr() ->getReplacementType()));}) DEF_TRAVERSE_TYPELOC(SubstTemplateTypeParmPackType
 
 clang::DEF_TRAVERSE_TYPELOC (TemplateSpecializationType, { TRY_TO(TraverseTemplateName(TL.getTypePtr() ->getTemplateName()));for(unsigned I=0, E=TL.getNumArgs();I !=E;++I) { TRY_TO(TraverseTemplateArgumentLoc(TL.getArgLoc(I)));} }) DEF_TRAVERSE_TYPELOC(ParenType
 
 clang::DEF_TRAVERSE_TYPELOC (AttributedType, { TRY_TO(TraverseTypeLoc(TL.getModifiedLoc()));}) DEF_TRAVERSE_TYPELOC(ElaboratedType
 
 clang::DEF_TRAVERSE_TYPELOC (DependentNameType, { TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));}) DEF_TRAVERSE_TYPELOC(DependentTemplateSpecializationType
 

Variables

const FunctionProtoType * clang::T = TL.getTypePtr()
 

Macro Definition Documentation

◆ ABSTRACT_DECL [1/2]

#define ABSTRACT_DECL (   DECL)

Definition at line 485 of file RecursiveASTVisitor.h.

◆ ABSTRACT_DECL [2/2]

#define ABSTRACT_DECL (   DECL)

Definition at line 485 of file RecursiveASTVisitor.h.

◆ ABSTRACT_STMT [1/3]

#define ABSTRACT_STMT (   STMT)

Definition at line 355 of file RecursiveASTVisitor.h.

◆ ABSTRACT_STMT [2/3]

#define ABSTRACT_STMT (   STMT)

Definition at line 355 of file RecursiveASTVisitor.h.

◆ ABSTRACT_STMT [3/3]

#define ABSTRACT_STMT (   STMT)

Definition at line 355 of file RecursiveASTVisitor.h.

◆ ABSTRACT_TYPE [1/2]

#define ABSTRACT_TYPE (   CLASS,
  BASE 
)

Definition at line 431 of file RecursiveASTVisitor.h.

◆ ABSTRACT_TYPE [2/2]

#define ABSTRACT_TYPE (   CLASS,
  BASE 
)

Definition at line 431 of file RecursiveASTVisitor.h.

◆ ABSTRACT_TYPELOC [1/2]

#define ABSTRACT_TYPELOC (   CLASS,
  BASE 
)

Definition at line 452 of file RecursiveASTVisitor.h.

◆ ABSTRACT_TYPELOC [2/2]

#define ABSTRACT_TYPELOC (   CLASS,
  BASE 
)

Definition at line 452 of file RecursiveASTVisitor.h.

◆ ATTR_VISITOR_DECLS_ONLY

#define ATTR_VISITOR_DECLS_ONLY

Definition at line 312 of file RecursiveASTVisitor.h.

◆ BINOP_LIST

#define BINOP_LIST ( )
Value:
OPERATOR(PtrMemD) OPERATOR(PtrMemI) OPERATOR(Mul) OPERATOR(Div) \
OPERATOR(Rem) OPERATOR(Add) OPERATOR(Sub) OPERATOR(Shl) OPERATOR(Shr) \
OPERATOR(LT) OPERATOR(GT) OPERATOR(LE) OPERATOR(GE) OPERATOR(EQ) \
OPERATOR(NE) OPERATOR(And) OPERATOR(Xor) OPERATOR(Or) OPERATOR(LAnd) \
OPERATOR(LOr) OPERATOR(Assign) OPERATOR(Comma)
#define OPERATOR(NAME)

Definition at line 62 of file RecursiveASTVisitor.h.

◆ CAO_LIST

#define CAO_LIST ( )
Value:
OPERATOR(Mul) OPERATOR(Div) OPERATOR(Rem) OPERATOR(Add) OPERATOR(Sub) \
OPERATOR(Shl) OPERATOR(Shr) OPERATOR(And) OPERATOR(Or) OPERATOR(Xor)
#define OPERATOR(NAME)

Definition at line 70 of file RecursiveASTVisitor.h.

◆ DECL [1/3]

#define DECL (   CLASS,
  BASE 
)    bool Traverse##CLASS##Decl(CLASS##Decl *D);

Definition at line 493 of file RecursiveASTVisitor.h.

◆ DECL [2/3]

#define DECL (   CLASS,
  BASE 
)
Value:
bool WalkUpFrom##CLASS##Decl(CLASS##Decl *D) { \
TRY_TO(WalkUpFrom##BASE(D)); \
TRY_TO(Visit##CLASS##Decl(D)); \
return true; \
} \
bool Visit##CLASS##Decl(CLASS##Decl *D) { return true; }
The l-value was an access to a declared entity or something equivalently strong, like the address of ...

Definition at line 493 of file RecursiveASTVisitor.h.

◆ DECL [3/3]

#define DECL (   CLASS,
  BASE 
)
Value:
case Decl::CLASS: \
if (!getDerived().Traverse##CLASS##Decl(static_cast<CLASS##Decl *>(D))) \
return false; \
break;
The l-value was an access to a declared entity or something equivalently strong, like the address of ...

Definition at line 493 of file RecursiveASTVisitor.h.

◆ DEF_TRAVERSE_DECL

#define DEF_TRAVERSE_DECL (   DECL,
  CODE 
)
Value:
template <typename Derived> \
bool RecursiveASTVisitor<Derived>::Traverse##DECL(DECL *D) { \
bool ShouldVisitChildren = true; \
bool ReturnValue = true; \
if (!getDerived().shouldTraversePostOrder()) \
TRY_TO(WalkUpFrom##DECL(D)); \
{ CODE; } \
if (ReturnValue && ShouldVisitChildren) \
TRY_TO(TraverseDeclContextHelper(dyn_cast<DeclContext>(D))); \
if (ReturnValue && getDerived().shouldTraversePostOrder()) \
TRY_TO(WalkUpFrom##DECL(D)); \
return ReturnValue; \
}
#define DECL(CLASS, BASE)

◆ DEF_TRAVERSE_STMT

#define DEF_TRAVERSE_STMT (   STMT,
  CODE 
)
Value:
template <typename Derived> \
bool RecursiveASTVisitor<Derived>::Traverse##STMT( \
STMT *S, DataRecursionQueue *Queue) { \
bool ShouldVisitChildren = true; \
bool ReturnValue = true; \
if (!getDerived().shouldTraversePostOrder()) \
TRY_TO(WalkUpFrom##STMT(S)); \
{ CODE; } \
if (ShouldVisitChildren) { \
for (Stmt * SubStmt : getDerived().getStmtChildren(S)) { \
TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(SubStmt); \
} \
} \
if (!Queue && ReturnValue && getDerived().shouldTraversePostOrder()) \
TRY_TO(WalkUpFrom##STMT(S)); \
return ReturnValue; \
}
#define STMT(CLASS, PARENT)

◆ DEF_TRAVERSE_TMPL_DECL

#define DEF_TRAVERSE_TMPL_DECL (   TMPLDECLKIND)
Value:
DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplateDecl, { \
TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters())); \
TRY_TO(TraverseDecl(D->getTemplatedDecl())); \
\
/* By default, we do not traverse the instantiations of \
class templates since they do not appear in the user code. The \
following code optionally traverses them. \
\
We only traverse the class instantiations when we see the canonical \
declaration of the template, to ensure we only visit them once. */ \
if (getDerived().shouldVisitTemplateInstantiations() && \
D == D->getCanonicalDecl()) \
TRY_TO(TraverseTemplateInstantiations(D)); \
\
/* Note that getInstantiatedFromMemberTemplate() is just a link \
from a template instantiation back to the template from which \
it was instantiated, and thus should not be traversed. */ \
})
#define TRY_TO(CALL_EXPR)
#define DEF_TRAVERSE_DECL(DECL, CODE)

◆ DEF_TRAVERSE_TMPL_INST

#define DEF_TRAVERSE_TMPL_INST (   TMPLDECLKIND)    bool TraverseTemplateInstantiations(TMPLDECLKIND##TemplateDecl *D);

Definition at line 512 of file RecursiveASTVisitor.h.

◆ DEF_TRAVERSE_TMPL_PART_SPEC_DECL

#define DEF_TRAVERSE_TMPL_PART_SPEC_DECL (   TMPLDECLKIND,
  DECLKIND 
)
Value:
DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplatePartialSpecializationDecl, { \
/* The partial specialization. */ \
if (TemplateParameterList *TPL = D->getTemplateParameters()) { \
for (TemplateParameterList::iterator I = TPL->begin(), E = TPL->end(); \
I != E; ++I) { \
TRY_TO(TraverseDecl(*I)); \
} \
} \
/* The args that remains unspecialized. */ \
TRY_TO(TraverseTemplateArgumentLocsHelper( \
D->getTemplateArgsAsWritten()->getTemplateArgs(), \
D->getTemplateArgsAsWritten()->NumTemplateArgs)); \
\
/* Don't need the *TemplatePartialSpecializationHelper, even \
though that's our parent class -- we already visit all the \
template args here. */ \
TRY_TO(Traverse##DECLKIND##Helper(D)); \
\
/* Instantiations will have been visited with the primary template. */ \
})
#define DEF_TRAVERSE_DECL(DECL, CODE)

◆ DEF_TRAVERSE_TMPL_SPEC_DECL

#define DEF_TRAVERSE_TMPL_SPEC_DECL (   TMPLDECLKIND)
Value:
DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplateSpecializationDecl, { \
/* For implicit instantiations ("set<int> x;"), we don't want to \
recurse at all, since the instatiated template isn't written in \
the source code anywhere. (Note the instatiated *type* -- \
set<int> -- is written, and will still get a callback of \
TemplateSpecializationType). For explicit instantiations \
("template set<int>;"), we do need a callback, since this \
is the only callback that's made for this instantiation. \
We use getTypeAsWritten() to distinguish. */ \
if (TypeSourceInfo *TSI = D->getTypeAsWritten()) \
TRY_TO(TraverseTypeLoc(TSI->getTypeLoc())); \
TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc())); \
if (!getDerived().shouldVisitTemplateInstantiations() && \
D->getTemplateSpecializationKind() != TSK_ExplicitSpecialization) \
/* Returning from here skips traversing the \
declaration context of the *TemplateSpecializationDecl \
(embedded in the DEF_TRAVERSE_DECL() macro) \
which contains the instantiated members of the template. */ \
return true; \
})
#define TRY_TO(CALL_EXPR)
#define DEF_TRAVERSE_DECL(DECL, CODE)
This template specialization was declared or defined by an explicit specialization (C++ [temp...
Definition: Specifiers.h:153

◆ DEF_TRAVERSE_TYPE

#define DEF_TRAVERSE_TYPE (   TYPE,
  CODE 
)
Value:
template <typename Derived> \
bool RecursiveASTVisitor<Derived>::Traverse##TYPE(TYPE *T) { \
if (!getDerived().shouldTraversePostOrder()) \
TRY_TO(WalkUpFrom##TYPE(T)); \
{ CODE; } \
if (getDerived().shouldTraversePostOrder()) \
TRY_TO(WalkUpFrom##TYPE(T)); \
return true; \
}
#define TYPE(CLASS, BASE)
const FunctionProtoType * T

Definition at line 939 of file RecursiveASTVisitor.h.

◆ DEF_TRAVERSE_TYPELOC

#define DEF_TRAVERSE_TYPELOC (   TYPE,
  CODE 
)
Value:
template <typename Derived> \
bool RecursiveASTVisitor<Derived>::Traverse##TYPE##Loc(TYPE##Loc TL) { \
if (getDerived().shouldWalkTypesOfTypeLocs()) \
TRY_TO(WalkUpFrom##TYPE(const_cast<TYPE *>(TL.getTypePtr()))); \
TRY_TO(WalkUpFrom##TYPE##Loc(TL)); \
{ CODE; } \
return true; \
}
#define TYPE(CLASS, BASE)

◆ DISPATCH

#define DISPATCH (   NAME,
  CLASS,
  VAR 
)    return getDerived().Traverse##NAME(static_cast<CLASS *>(VAR))

Definition at line 665 of file RecursiveASTVisitor.h.

◆ DISPATCH_STMT

#define DISPATCH_STMT (   NAME,
  CLASS,
  VAR 
)    return TRAVERSE_STMT_BASE(NAME, CLASS, VAR, Queue);

◆ GENERAL_BINOP_FALLBACK

#define GENERAL_BINOP_FALLBACK (   NAME,
  BINOP_TYPE 
)
Value:
bool TraverseBin##NAME(BINOP_TYPE *S, DataRecursionQueue *Queue = nullptr) { \
if (!getDerived().shouldTraversePostOrder()) \
TRY_TO(WalkUpFromBin##NAME(S)); \
TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getLHS()); \
TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getRHS()); \
return true; \
} \
bool WalkUpFromBin##NAME(BINOP_TYPE *S) { \
TRY_TO(WalkUpFrom##BINOP_TYPE(S)); \
TRY_TO(VisitBin##NAME(S)); \
return true; \
} \
bool VisitBin##NAME(BINOP_TYPE *S) { return true; }

Definition at line 397 of file RecursiveASTVisitor.h.

◆ INITLISTEXPR

#define INITLISTEXPR (   CLASS,
  PARENT 
)
Value:
case Stmt::CLASS##Class: \
{ \
auto ILE = static_cast<CLASS *>(S); \
if (auto Syn = ILE->isSemanticForm() ? ILE->getSyntacticForm() : ILE) \
TRY_TO(WalkUpFrom##CLASS(Syn)); \
if (auto Sem = ILE->isSemanticForm() ? ILE : ILE->getSemanticForm()) \
TRY_TO(WalkUpFrom##CLASS(Sem)); \
break; \
}
#define TRY_TO(CALL_EXPR)

◆ OPENMP_CLAUSE [1/2]

#define OPENMP_CLAUSE (   Name,
  Class 
)    bool Visit##Class(Class *C);

Definition at line 530 of file RecursiveASTVisitor.h.

◆ OPENMP_CLAUSE [2/2]

#define OPENMP_CLAUSE (   Name,
  Class 
)
Value:
case OMPC_##Name: \
TRY_TO(Visit##Class(static_cast<Class *>(C))); \
break;

Definition at line 530 of file RecursiveASTVisitor.h.

◆ OPERATOR [1/6]

#define OPERATOR (   NAME)
Value:
bool TraverseUnary##NAME(UnaryOperator *S, \
DataRecursionQueue *Queue = nullptr) { \
if (!getDerived().shouldTraversePostOrder()) \
TRY_TO(WalkUpFromUnary##NAME(S)); \
TRY_TO_TRAVERSE_OR_ENQUEUE_STMT(S->getSubExpr()); \
return true; \
} \
bool WalkUpFromUnary##NAME(UnaryOperator *S) { \
TRY_TO(WalkUpFromUnaryOperator(S)); \
TRY_TO(VisitUnary##NAME(S)); \
return true; \
} \
bool VisitUnary##NAME(UnaryOperator *S) { return true; }

Definition at line 420 of file RecursiveASTVisitor.h.

◆ OPERATOR [2/6]

#define OPERATOR (   NAME)    GENERAL_BINOP_FALLBACK(NAME, BinaryOperator)

Definition at line 420 of file RecursiveASTVisitor.h.

◆ OPERATOR [3/6]

#define OPERATOR (   NAME)    GENERAL_BINOP_FALLBACK(NAME##Assign, CompoundAssignOperator)

Definition at line 420 of file RecursiveASTVisitor.h.

◆ OPERATOR [4/6]

#define OPERATOR (   NAME)
Value:
case BO_##NAME: \
DISPATCH_STMT(Bin##NAME, BinaryOperator, S);

Definition at line 420 of file RecursiveASTVisitor.h.

◆ OPERATOR [5/6]

#define OPERATOR (   NAME)
Value:
case BO_##NAME##Assign: \
DISPATCH_STMT(Bin##NAME##Assign, CompoundAssignOperator, S);

Definition at line 420 of file RecursiveASTVisitor.h.

◆ OPERATOR [6/6]

#define OPERATOR (   NAME)
Value:
case UO_##NAME: \
DISPATCH_STMT(Unary##NAME, UnaryOperator, S);

Definition at line 420 of file RecursiveASTVisitor.h.

◆ STMT [1/4]

#define STMT (   CLASS,
  PARENT 
)    bool Traverse##CLASS(CLASS *S, DataRecursionQueue *Queue = nullptr);

Definition at line 364 of file RecursiveASTVisitor.h.

◆ STMT [2/4]

#define STMT (   CLASS,
  PARENT 
)
Value:
bool WalkUpFrom##CLASS(CLASS *S) { \
TRY_TO(WalkUpFrom##PARENT(S)); \
TRY_TO(Visit##CLASS(S)); \
return true; \
} \
bool Visit##CLASS(CLASS *S) { return true; }

Definition at line 364 of file RecursiveASTVisitor.h.

◆ STMT [3/4]

#define STMT (   CLASS,
  PARENT 
)
Value:
case Stmt::CLASS##Class: \
DISPATCH_STMT(CLASS, CLASS, S);

Definition at line 364 of file RecursiveASTVisitor.h.

◆ STMT [4/4]

#define STMT (   CLASS,
  PARENT 
)
Value:
case Stmt::CLASS##Class: \
TRY_TO(WalkUpFrom##CLASS(static_cast<CLASS *>(S))); break;

Definition at line 364 of file RecursiveASTVisitor.h.

◆ TRAVERSE_STMT_BASE

#define TRAVERSE_STMT_BASE (   NAME,
  CLASS,
  VAR,
  QUEUE 
)
Value:
(has_same_member_pointer_type<decltype( \
&RecursiveASTVisitor::Traverse##NAME), \
decltype(&Derived::Traverse##NAME)>::value \
? static_cast<typename std::conditional< \
has_same_member_pointer_type< \
decltype(&RecursiveASTVisitor::Traverse##NAME), \
decltype(&Derived::Traverse##NAME)>::value, \
Derived &, RecursiveASTVisitor &>::type>(*this) \
.Traverse##NAME(static_cast<CLASS *>(VAR), QUEUE) \
: getDerived().Traverse##NAME(static_cast<CLASS *>(VAR)))

Definition at line 332 of file RecursiveASTVisitor.h.

◆ TRY_TO

#define TRY_TO (   CALL_EXPR)
Value:
do { \
if (!getDerived().CALL_EXPR) \
return false; \
} while (false)

Definition at line 80 of file RecursiveASTVisitor.h.

◆ TRY_TO_TRAVERSE_OR_ENQUEUE_STMT

#define TRY_TO_TRAVERSE_OR_ENQUEUE_STMT (   S)
Value:
do { \
if (!TRAVERSE_STMT_BASE(Stmt, Stmt, S, Queue)) \
return false; \
} while (false)
#define TRAVERSE_STMT_BASE(NAME, CLASS, VAR, QUEUE)

Definition at line 347 of file RecursiveASTVisitor.h.

Referenced by clang::RecursiveASTVisitor< CallGraph >::TraverseLambdaBody().

◆ TYPE [1/4]

#define TYPE (   CLASS,
  BASE 
)    bool Traverse##CLASS##Type(CLASS##Type *T);

Definition at line 473 of file RecursiveASTVisitor.h.

Referenced by clang::DEF_TRAVERSE_TYPE().

◆ TYPE [2/4]

#define TYPE (   CLASS,
  BASE 
)
Value:
bool WalkUpFrom##CLASS##Type(CLASS##Type *T) { \
TRY_TO(WalkUpFrom##BASE(T)); \
TRY_TO(Visit##CLASS##Type(T)); \
return true; \
} \
bool Visit##CLASS##Type(CLASS##Type *T) { return true; }
const FunctionProtoType * T
The l-value was considered opaque, so the alignment was determined from a type.

Definition at line 473 of file RecursiveASTVisitor.h.

◆ TYPE [3/4]

#define TYPE (   CLASS,
  BASE 
)
Value:
bool WalkUpFrom##CLASS##TypeLoc(CLASS##TypeLoc TL) { \
TRY_TO(WalkUpFrom##BASE##Loc(TL)); \
TRY_TO(Visit##CLASS##TypeLoc(TL)); \
return true; \
} \
bool Visit##CLASS##TypeLoc(CLASS##TypeLoc TL) { return true; }

Definition at line 473 of file RecursiveASTVisitor.h.

◆ TYPE [4/4]

#define TYPE (   CLASS,
  BASE 
)
Value:
case Type::CLASS: \
DISPATCH(CLASS##Type, CLASS##Type, const_cast<Type *>(T.getTypePtr()));
const FunctionProtoType * T

Definition at line 473 of file RecursiveASTVisitor.h.

◆ TYPELOC [1/2]

#define TYPELOC (   CLASS,
  BASE 
)    bool Traverse##CLASS##TypeLoc(CLASS##TypeLoc TL);

Definition at line 453 of file RecursiveASTVisitor.h.

◆ TYPELOC [2/2]

#define TYPELOC (   CLASS,
  BASE 
)
Value:
case TypeLoc::CLASS: \
return getDerived().Traverse##CLASS##TypeLoc(TL.castAs<CLASS##TypeLoc>());

Definition at line 453 of file RecursiveASTVisitor.h.

◆ UNARYOP_LIST

#define UNARYOP_LIST ( )
Value:
OPERATOR(PostInc) OPERATOR(PostDec) OPERATOR(PreInc) OPERATOR(PreDec) \
OPERATOR(AddrOf) OPERATOR(Deref) OPERATOR(Plus) OPERATOR(Minus) \
OPERATOR(Not) OPERATOR(LNot) OPERATOR(Real) OPERATOR(Imag) \
OPERATOR(Extension) OPERATOR(Coawait)
#define OPERATOR(NAME)

Definition at line 55 of file RecursiveASTVisitor.h.

◆ VISITORCLASS

#define VISITORCLASS   RecursiveASTVisitor

Definition at line 701 of file RecursiveASTVisitor.h.