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

Methods

ASTVisitor(
    clang::ParentMapContext::ParentMap& Map)

Declared at: clang/lib/AST/ParentMapContext.cpp:347

Parameters

clang::ParentMapContext::ParentMap& Map

bool TraverseAttr(clang::Attr* AttrNode)

Declared at: clang/lib/AST/ParentMapContext.cpp:437

Parameters

clang::Attr* AttrNode

bool TraverseDecl(clang::Decl* DeclNode)

Declared at: clang/lib/AST/ParentMapContext.cpp:420

Parameters

clang::Decl* DeclNode

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)

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)

Declared at: clang/lib/AST/ParentMapContext.cpp:442

Parameters

clang::ObjCProtocolLoc ProtocolLocNode

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)

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)

Declared at: clang/lib/AST/ParentMapContext.cpp:455

Parameters

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)

Declared at: clang/lib/AST/ParentMapContext.cpp:405

Parameters

clang::ObjCProtocolLoc 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

Declared at: clang/lib/AST/ParentMapContext.cpp:356

bool shouldVisitTemplateInstantiations() const

Declared at: clang/lib/AST/ParentMapContext.cpp:354