clang  6.0.0svn
Public Member Functions | List of all members
clang::tooling::RecursiveSymbolVisitor< T > Class Template Reference

Traverses the AST and visits the occurrence of each named symbol in the given nodes. More...

#include "clang/Tooling/Refactoring/RecursiveSymbolVisitor.h"

Inheritance diagram for clang::tooling::RecursiveSymbolVisitor< T >:
Inheritance graph
[legend]
Collaboration diagram for clang::tooling::RecursiveSymbolVisitor< T >:
Collaboration graph
[legend]

Public Member Functions

 RecursiveSymbolVisitor (const SourceManager &SM, const LangOptions &LangOpts)
 
bool visitSymbolOccurrence (const NamedDecl *ND, ArrayRef< SourceRange > NameRanges)
 
bool VisitNamedDecl (const NamedDecl *D)
 
bool VisitCXXConstructorDecl (const CXXConstructorDecl *CD)
 
bool VisitDeclRefExpr (const DeclRefExpr *Expr)
 
bool VisitMemberExpr (const MemberExpr *Expr)
 
bool VisitTypeLoc (const TypeLoc Loc)
 
bool TraverseNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS)
 
- Public Member Functions inherited from clang::RecursiveASTVisitor< RecursiveSymbolVisitor< T > >
RecursiveSymbolVisitor< T > & getDerived ()
 Return a reference to the derived class. More...
 
bool shouldVisitTemplateInstantiations () const
 Return whether this visitor should recurse into template instantiations. More...
 
bool shouldWalkTypesOfTypeLocs () const
 Return whether this visitor should recurse into the types of TypeLocs. More...
 
bool shouldVisitImplicitCode () const
 Return whether this visitor should recurse into implicit code, e.g., implicit constructors and destructors. More...
 
bool shouldTraversePostOrder () const
 Return whether this visitor should traverse post-order. More...
 
bool TraverseStmt (Stmt *S, DataRecursionQueue *Queue=nullptr)
 Recursively visit a statement or expression, by dispatching to Traverse*() based on the argument's dynamic type. More...
 
bool dataTraverseStmtPre (Stmt *S)
 Invoked before visiting a statement or expression via data recursion. More...
 
bool dataTraverseStmtPost (Stmt *S)
 Invoked after visiting a statement or expression via data recursion. More...
 
bool TraverseType (QualType T)
 Recursively visit a type, by dispatching to Traverse*Type() based on the argument's getTypeClass() property. More...
 
bool TraverseTypeLoc (TypeLoc TL)
 Recursively visit a type with location, by dispatching to Traverse*TypeLoc() based on the argument type's getTypeClass() property. More...
 
bool TraverseAttr (Attr *At)
 Recursively visit an attribute, by dispatching to Traverse*Attr() based on the argument's dynamic type. More...
 
bool TraverseDecl (Decl *D)
 Recursively visit a declaration, by dispatching to Traverse*Decl() based on the argument's dynamic type. More...
 
bool TraverseNestedNameSpecifier (NestedNameSpecifier *NNS)
 Recursively visit a C++ nested-name-specifier. More...
 
bool TraverseNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS)
 Recursively visit a C++ nested-name-specifier with location information. More...
 
bool TraverseDeclarationNameInfo (DeclarationNameInfo NameInfo)
 Recursively visit a name with its location information. More...
 
bool TraverseTemplateName (TemplateName Template)
 Recursively visit a template name and dispatch to the appropriate method. More...
 
bool TraverseTemplateArgument (const TemplateArgument &Arg)
 Recursively visit a template argument and dispatch to the appropriate method for the argument type. More...
 
bool TraverseTemplateArgumentLoc (const TemplateArgumentLoc &ArgLoc)
 Recursively visit a template argument location and dispatch to the appropriate method for the argument type. More...
 
bool TraverseTemplateArguments (const TemplateArgument *Args, unsigned NumArgs)
 Recursively visit a set of template arguments. More...
 
bool TraverseCXXBaseSpecifier (const CXXBaseSpecifier &Base)
 Recursively visit a base specifier. More...
 
bool TraverseConstructorInitializer (CXXCtorInitializer *Init)
 Recursively visit a constructor initializer. More...
 
bool TraverseLambdaCapture (LambdaExpr *LE, const LambdaCapture *C, Expr *Init)
 Recursively visit a lambda capture. More...
 
bool TraverseLambdaBody (LambdaExpr *LE, DataRecursionQueue *Queue=nullptr)
 Recursively visit the body of a lambda expression. More...
 
bool TraverseSynOrSemInitListExpr (InitListExpr *S, DataRecursionQueue *Queue=nullptr)
 Recursively visit the syntactic or semantic form of an initialization list. More...
 
bool VisitAttr (Attr *A)
 
Stmt::child_range getStmtChildren (Stmt *S)
 
bool WalkUpFromStmt (Stmt *S)
 
bool VisitStmt (Stmt *S)
 
bool WalkUpFromType (Type *T)
 
bool VisitType (Type *T)
 
bool WalkUpFromTypeLoc (TypeLoc TL)
 
bool VisitTypeLoc (TypeLoc TL)
 
bool WalkUpFromQualifiedTypeLoc (QualifiedTypeLoc TL)
 
bool VisitQualifiedTypeLoc (QualifiedTypeLoc TL)
 
bool WalkUpFromUnqualTypeLoc (UnqualTypeLoc TL)
 
bool VisitUnqualTypeLoc (UnqualTypeLoc TL)
 
bool WalkUpFromDecl (Decl *D)
 
bool VisitDecl (Decl *D)
 
bool canIgnoreChildDeclWhileTraversingDeclContext (const Decl *Child)
 

Additional Inherited Members

- Public Types inherited from clang::RecursiveASTVisitor< RecursiveSymbolVisitor< T > >
typedef SmallVectorImpl< llvm::PointerIntPair< Stmt *, 1, bool > > DataRecursionQueue
 A queue used for performing data recursion over statements. More...
 

Detailed Description

template<typename T>
class clang::tooling::RecursiveSymbolVisitor< T >

Traverses the AST and visits the occurrence of each named symbol in the given nodes.

Definition at line 29 of file RecursiveSymbolVisitor.h.

Constructor & Destructor Documentation

◆ RecursiveSymbolVisitor()

template<typename T >
clang::tooling::RecursiveSymbolVisitor< T >::RecursiveSymbolVisitor ( const SourceManager SM,
const LangOptions LangOpts 
)
inline

Definition at line 34 of file RecursiveSymbolVisitor.h.

Member Function Documentation

◆ TraverseNestedNameSpecifierLoc()

template<typename T >
bool clang::tooling::RecursiveSymbolVisitor< T >::TraverseNestedNameSpecifierLoc ( NestedNameSpecifierLoc  NNS)
inline

Definition at line 93 of file RecursiveSymbolVisitor.h.

◆ VisitCXXConstructorDecl()

template<typename T >
bool clang::tooling::RecursiveSymbolVisitor< T >::VisitCXXConstructorDecl ( const CXXConstructorDecl CD)
inline

◆ VisitDeclRefExpr()

template<typename T >
bool clang::tooling::RecursiveSymbolVisitor< T >::VisitDeclRefExpr ( const DeclRefExpr Expr)
inline

◆ VisitMemberExpr()

template<typename T >
bool clang::tooling::RecursiveSymbolVisitor< T >::VisitMemberExpr ( const MemberExpr Expr)
inline

◆ VisitNamedDecl()

template<typename T >
bool clang::tooling::RecursiveSymbolVisitor< T >::VisitNamedDecl ( const NamedDecl D)
inline

Definition at line 44 of file RecursiveSymbolVisitor.h.

References clang::Decl::getLocation().

◆ visitSymbolOccurrence()

template<typename T >
bool clang::tooling::RecursiveSymbolVisitor< T >::visitSymbolOccurrence ( const NamedDecl ND,
ArrayRef< SourceRange NameRanges 
)
inline

Definition at line 37 of file RecursiveSymbolVisitor.h.

◆ VisitTypeLoc()

template<typename T >
bool clang::tooling::RecursiveSymbolVisitor< T >::VisitTypeLoc ( const TypeLoc  Loc)
inline

The documentation for this class was generated from the following file: