A dynamically typed AST node container.
Stores an AST node in a type safe way. This allows writing code that works with different kinds of AST nodes, despite the fact that they don't have a common base class.
Use create(Node)
to create a DynTypedNode
from an AST node, and get<T>()
to retrieve the node as type T if the types match.
See ASTNodeKind
for which node base types are currently supported; You can create DynTypedNodes for all nodes in the inheritance hierarchy of the supported base types.
Definition at line 257 of file ASTTypeTraits.h.
const T * clang::DynTypedNode::get ( ) const inlineRetrieve the stored node as type T
.
Returns NULL if the stored node does not have a type that is convertible to T
.
For types that have identity via their pointer in the AST (like Stmt
, Decl
, Type
and NestedNameSpecifier
) the returned pointer points to the referenced AST node. For other types (like QualType
) the value is stored directly in the DynTypedNode
, and the returned pointer points at the storage inside DynTypedNode. For those nodes, do not use the pointer outside the scope of the DynTypedNode.
Definition at line 277 of file ASTTypeTraits.h.
Referenced by clang::ast_matchers::AST_MATCHER_P(), dump(), findDeepestWithKind(), clang::ast_matchers::MatchDescendantVisitor::findMatch(), clang::tooling::CodeRangeASTSelection::getFunctionLikeNearestParent(), clang::diff::SyntaxTree::Impl::getNodeValue(), clang::CallGraph::getOrInsertNode(), clang::ParentMapContext::ParentMap::getParents(), clang::tooling::CodeRangeASTSelection::isInFunctionLikeBodyOfCode(), clang::transformer::member(), clang::transformer::name(), clang::transformer::node(), clang::transformer::detail::rewriteDescendants(), clang::ParentMapContext::traverseIgnored(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
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