clang  10.0.0svn
Public Types | Public Member Functions | Public Attributes | List of all members
clang::tooling::SelectedASTNode Struct Reference

Represents a selected AST node. More...

#include "clang/Tooling/Refactoring/ASTSelection.h"

Collaboration diagram for clang::tooling::SelectedASTNode:
Collaboration graph

Public Types

using ReferenceType = std::reference_wrapper< const SelectedASTNode >

Public Member Functions

 SelectedASTNode (const ast_type_traits::DynTypedNode &Node, SourceSelectionKind SelectionKind)
 SelectedASTNode (SelectedASTNode &&)=default
SelectedASTNodeoperator= (SelectedASTNode &&)=default
void dump (llvm::raw_ostream &OS=llvm::errs()) const

Public Attributes

ast_type_traits::DynTypedNode Node
SourceSelectionKind SelectionKind
std::vector< SelectedASTNodeChildren

Detailed Description

Represents a selected AST node.

AST selection is represented using a tree of SelectedASTNode. The tree follows the top-down shape of the actual AST. Each selected node has a selection kind. The kind might be none as the node itself might not actually be selected, e.g. a statement in macro whose child is in a macro argument.

Definition at line 49 of file ASTSelection.h.

Member Typedef Documentation

◆ ReferenceType

using clang::tooling::SelectedASTNode::ReferenceType = std::reference_wrapper<const SelectedASTNode>

Definition at line 62 of file ASTSelection.h.

Constructor & Destructor Documentation

◆ SelectedASTNode() [1/2]

clang::tooling::SelectedASTNode::SelectedASTNode ( const ast_type_traits::DynTypedNode Node,
SourceSelectionKind  SelectionKind 

Definition at line 54 of file ASTSelection.h.

References dump().

◆ SelectedASTNode() [2/2]

clang::tooling::SelectedASTNode::SelectedASTNode ( SelectedASTNode &&  )

Member Function Documentation

◆ dump()

void SelectedASTNode::dump ( llvm::raw_ostream &  OS = llvm::errs()) const

Definition at line 231 of file ASTSelection.cpp.

References dump().

◆ operator=()

SelectedASTNode& clang::tooling::SelectedASTNode::operator= ( SelectedASTNode &&  )

Member Data Documentation

◆ Children

std::vector<SelectedASTNode> clang::tooling::SelectedASTNode::Children

Definition at line 52 of file ASTSelection.h.

Referenced by dump(), findDeepestWithKind(), and hasAnyDirectChildrenWithKind().

◆ Node

ast_type_traits::DynTypedNode clang::tooling::SelectedASTNode::Node

Definition at line 50 of file ASTSelection.h.

Referenced by dump(), and findDeepestWithKind().

◆ SelectionKind

SourceSelectionKind clang::tooling::SelectedASTNode::SelectionKind

Definition at line 51 of file ASTSelection.h.

Referenced by dump().

The documentation for this struct was generated from the following files: