clang 19.0.0git
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"

Public Types

using ReferenceType = std::reference_wrapper< const SelectedASTNode >

Public Member Functions

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

Public Attributes

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 52 of file ASTSelection.h.

Member Typedef Documentation

◆ ReferenceType

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

Definition at line 64 of file ASTSelection.h.

Constructor & Destructor Documentation

◆ SelectedASTNode() [1/2]

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

Definition at line 57 of file ASTSelection.h.

◆ 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().

Referenced by dump().

◆ operator=()

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

Member Data Documentation

◆ Children

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

Definition at line 55 of file ASTSelection.h.

Referenced by findDeepestWithKind().

◆ Node

DynTypedNode clang::tooling::SelectedASTNode::Node

Definition at line 53 of file ASTSelection.h.

Referenced by findDeepestWithKind().

◆ SelectionKind

SourceSelectionKind clang::tooling::SelectedASTNode::SelectionKind

Definition at line 54 of file ASTSelection.h.

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