14#ifndef LLVM_CLANG_AST_PARENTMAPCONTEXT_H
15#define LLVM_CLANG_AST_PARENTMAPCONTEXT_H
21class DynTypedNodeList;
72 std::unique_ptr<ParentMap> Parents;
81 : Ctx(ASTCtx.getParentMapContext()) {
82 TK = Ctx.getTraversalKind();
84 Ctx.setTraversalKind(*ScopeTK);
120 assert(N <
size() &&
"Out of bounds!");
121 return *(
begin() + N);
125template <
typename NodeT>
130template <
typename NodeT>
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ParentMapContext & getParentMapContext()
Returns the dynamic AST node parent map context.
DynTypedNodeList getParents(const NodeT &Node)
Forwards to get node parents from the ParentMapContext.
Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode.
DynTypedNodeList(const DynTypedNode &N)
DynTypedNodeList(ArrayRef< DynTypedNode > A)
const DynTypedNode * end() const
ArrayRef< DynTypedNode > Nodes
const DynTypedNode & operator[](size_t N) const
const DynTypedNode * begin() const
A dynamically typed AST node container.
static DynTypedNode create(const T &Node)
Creates a DynTypedNode from Node.
This represents one expression.
const Expr * traverseIgnored(const Expr *E) const
void clear()
Clear parent maps.
void setTraversalKind(TraversalKind TK)
TraversalKind getTraversalKind() const
DynTypedNodeList getParents(const NodeT &Node)
Returns the parents of the given node (within the traversal scope).
TraversalKindScope(ASTContext &ASTCtx, std::optional< TraversalKind > ScopeTK)
The JSON file list parser is used to communicate input to InstallAPI.
TraversalKind
Defines how we descend a level in the AST when we pass through expressions.
@ TK_AsIs
Will traverse all child nodes.