#include "clang/AST/ParentMapContext.h"
Definition at line 23 of file ParentMapContext.h.
◆ ParentMapContext() ◆ ~ParentMapContext() ParentMapContext::~ParentMapContext ( ) default ◆ clear() void ParentMapContext::clear ( ) ◆ getParents() [1/2] ◆ getParents() [2/2]template<typename NodeT >
Returns the parents of the given node (within the traversal scope).
Note that this will lazily compute the parents of all nodes and store them for later retrieval. Thus, the first call is O(n) in the number of AST nodes.
Caveats and FIXMEs: Calculating the parent map over all AST nodes will need to load the full AST. This can be undesirable in the case where the full AST is expensive to create (for example, when using precompiled header preambles). Thus, there are good opportunities for optimization here. One idea is to walk the given node downwards, looking for references to declaration contexts - once a declaration context is found, compute the parent map for the declaration context; if that can satisfy the request, loading the whole AST can be avoided. Note that this is made more complex by statements in templates having multiple parents - those problems can be solved by building closure over the templated parts of the AST, which also avoids touching large parts of the AST. Additionally, we will want to add an interface to already give a hint where to search for the parents, for example when looking at a statement inside a certain function.
'NodeT' can be one of Decl, Stmt, Type, TypeLoc, NestedNameSpecifier or NestedNameSpecifierLoc.
Definition at line 126 of file ParentMapContext.h.
References clang::DynTypedNode::create(), getParents(), and Node.
Referenced by clang::ASTContext::getParents(), getParents(), isInCondition(), and matchesPostDecrInWhile().
◆ getTraversalKind() TraversalKind clang::ParentMapContext::getTraversalKind ( ) const inline ◆ setTraversalKind() ◆ traverseIgnored() [1/3] ◆ traverseIgnored() [2/3] const Expr * ParentMapContext::traverseIgnored ( const Expr * E ) const ◆ traverseIgnored() [3/3] Expr * ParentMapContext::traverseIgnored ( Expr * E ) constThe documentation for this class was generated from the following files:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4