class ParentMap::ASTVisitor
Declaration
class ParentMap::ASTVisitor : public RecursiveASTVisitor { /* full declaration omitted */ };
Description
A \c RecursiveASTVisitor that builds a map from nodes to their parents as defined by the \c RecursiveASTVisitor. Note that the relationship described here is purely in terms of AST traversal - there are other relationships (for example declaration context) in the AST that are better modeled by special matchers.
Declared at: clang/lib/AST/ParentMapContext.cpp:344
Inherits from: RecursiveASTVisitor
Member Variables
- private clang::ParentMapContext::ParentMap& Map
- private llvm::SmallVector<DynTypedNode, 16> ParentStack
Method Overview
- public ASTVisitor(clang::ParentMapContext::ParentMap & Map)
- private bool TraverseAttr(clang::Attr * AttrNode)
- private bool TraverseDecl(clang::Decl * DeclNode)
- private bool TraverseNestedNameSpecifierLoc(clang::NestedNameSpecifierLoc NNSLocNode)
- private template <typename T, typename MapNodeTy, typename BaseTraverseFn, typename MapTy>bool TraverseNode(T Node, MapNodeTy MapNode, BaseTraverseFn BaseTraverse, MapTy * Parents)
- private bool TraverseObjCProtocolLoc(clang::ObjCProtocolLoc ProtocolLocNode)
- private bool TraverseTypeLoc(clang::TypeLoc TypeLocNode)
- private template <typename MapNodeTy, typename MapTy>void addParent(MapNodeTy MapNode, MapTy * Parents)
- private bool dataTraverseStmtPost(clang::Stmt * StmtNode)
- private bool dataTraverseStmtPre(clang::Stmt * StmtNode)
- private static bool isNull(clang::ObjCProtocolLoc Node)
- private template <typename T>static bool isNull(T Node)
- private bool shouldVisitImplicitCode() const
- private bool shouldVisitTemplateInstantiations() const
Methods
¶ASTVisitor(
clang::ParentMapContext::ParentMap& Map)
ASTVisitor(
clang::ParentMapContext::ParentMap& Map)
Declared at: clang/lib/AST/ParentMapContext.cpp:347
Parameters
¶bool TraverseAttr(clang::Attr* AttrNode)
bool TraverseAttr(clang::Attr* AttrNode)
Declared at: clang/lib/AST/ParentMapContext.cpp:437
Parameters
- clang::Attr* AttrNode
¶bool TraverseDecl(clang::Decl* DeclNode)
bool TraverseDecl(clang::Decl* DeclNode)
Declared at: clang/lib/AST/ParentMapContext.cpp:420
Parameters
- clang::Decl* DeclNode
¶bool TraverseNestedNameSpecifierLoc(
clang::NestedNameSpecifierLoc NNSLocNode)
bool TraverseNestedNameSpecifierLoc(
clang::NestedNameSpecifierLoc NNSLocNode)
Declared at: clang/lib/AST/ParentMapContext.cpp:431
Parameters
- clang::NestedNameSpecifierLoc NNSLocNode
¶template <typename T,
typename MapNodeTy,
typename BaseTraverseFn,
typename MapTy>
bool TraverseNode(T Node,
MapNodeTy MapNode,
BaseTraverseFn BaseTraverse,
MapTy* Parents)
template <typename T,
typename MapNodeTy,
typename BaseTraverseFn,
typename MapTy>
bool TraverseNode(T Node,
MapNodeTy MapNode,
BaseTraverseFn BaseTraverse,
MapTy* Parents)
Declared at: clang/lib/AST/ParentMapContext.cpp:409
Templates
- T
- MapNodeTy
- BaseTraverseFn
- MapTy
Parameters
- T Node
- MapNodeTy MapNode
- BaseTraverseFn BaseTraverse
- MapTy* Parents
¶bool TraverseObjCProtocolLoc(
clang::ObjCProtocolLoc ProtocolLocNode)
bool TraverseObjCProtocolLoc(
clang::ObjCProtocolLoc ProtocolLocNode)
Declared at: clang/lib/AST/ParentMapContext.cpp:442
Parameters
- clang::ObjCProtocolLoc ProtocolLocNode
¶bool TraverseTypeLoc(clang::TypeLoc TypeLocNode)
bool TraverseTypeLoc(clang::TypeLoc TypeLocNode)
Declared at: clang/lib/AST/ParentMapContext.cpp:425
Parameters
- clang::TypeLoc TypeLocNode
¶template <typename MapNodeTy, typename MapTy>
void addParent(MapNodeTy MapNode, MapTy* Parents)
template <typename MapNodeTy, typename MapTy>
void addParent(MapNodeTy MapNode, MapTy* Parents)
Description
Record the parent of the node we're visiting. MapNode is the child, the parent is on top of ParentStack. Parents is the parent storage (either PointerParents or OtherParents).
Declared at: clang/lib/AST/ParentMapContext.cpp:362
Templates
- MapNodeTy
- MapTy
Parameters
- MapNodeTy MapNode
- MapTy* Parents
¶bool dataTraverseStmtPost(clang::Stmt* StmtNode)
bool dataTraverseStmtPost(clang::Stmt* StmtNode)
Declared at: clang/lib/AST/ParentMapContext.cpp:455
Parameters
- clang::Stmt* StmtNode
¶bool dataTraverseStmtPre(clang::Stmt* StmtNode)
bool dataTraverseStmtPre(clang::Stmt* StmtNode)
Declared at: clang/lib/AST/ParentMapContext.cpp:450
Parameters
- clang::Stmt* StmtNode
¶static bool isNull(clang::ObjCProtocolLoc Node)
static bool isNull(clang::ObjCProtocolLoc Node)
Declared at: clang/lib/AST/ParentMapContext.cpp:405
Parameters
¶template <typename T>
static bool isNull(T Node)
template <typename T>
static bool isNull(T Node)
Declared at: clang/lib/AST/ParentMapContext.cpp:404
Templates
- T
Parameters
- T Node
¶bool shouldVisitImplicitCode() const
bool shouldVisitImplicitCode() const
Declared at: clang/lib/AST/ParentMapContext.cpp:356
¶bool shouldVisitTemplateInstantiations() const
bool shouldVisitTemplateInstantiations() const
Declared at: clang/lib/AST/ParentMapContext.cpp:354