clang 10.0.0git

Public Member Functions | Public Attributes | List of all members
clang::diff::Node Struct Reference

Represents a Clang AST node, alongside some additional information. More...

`#include "clang/Tooling/ASTDiff/ASTDiff.h"`

Collaboration diagram for clang::diff::Node:
[legend]

## Public Member Functions
ast_type_traits::ASTNodeKind | getType () const
StringRef | getTypeLabel () const
bool | isLeaf () const
llvm::Optional< StringRef > | getIdentifier () const
llvm::Optional< std::string > | getQualifiedIdentifier () const

## Public Attributes
NodeId | Parent
NodeId | LeftMostDescendant
NodeId | RightMostDescendant
int | Depth
int | Height
int | Shift = 0
ast_type_traits::DynTypedNode | ASTNode
SmallVector< NodeId, 4 > | Children
ChangeKind | Change = None

## Detailed Description

Represents a Clang AST node, alongside some additional information.

Definition at line 37 of file ASTDiff.h.

## Member Function Documentation

## ◆ getIdentifier()

llvm::Optional< StringRef > clang::diff::Node::getIdentifier | ( |  | ) | const

Definition at line 700 of file ASTDiff.cpp.

References clang::diff::SyntaxTree::Impl::getNode(), Height, clang::None, and Tree.

Referenced by isLeaf().

## ◆ getQualifiedIdentifier()

llvm::Optional< std::string > clang::diff::Node::getQualifiedIdentifier | ( |  | ) | const

Definition at line 692 of file ASTDiff.cpp.

References clang::None.

Referenced by isLeaf().

## ◆ getType()

ast_type_traits::ASTNodeKind clang::diff::Node::getType | ( |  | ) | const

Definition at line 686 of file ASTDiff.cpp.

Referenced by clang::diff::ComparisonOptions::isMatchingAllowed().

## ◆ getTypeLabel()

StringRef clang::diff::Node::getTypeLabel | ( |  | ) | const

Definition at line 690 of file ASTDiff.cpp.

## ◆ isLeaf()

bool clang::diff::Node::isLeaf | ( |  | ) | const
| inline

Definition at line 46 of file ASTDiff.h.

References getIdentifier(), and getQualifiedIdentifier().

Referenced by clang::diff::Subtree::getNodeValue().

## Member Data Documentation

## ◆ ASTNode

ast_type_traits::DynTypedNode clang::diff::Node::ASTNode

Definition at line 40 of file ASTDiff.h.

Referenced by clang::diff::SyntaxTree::Impl::getNodeValue(), and clang::diff::SyntaxTree::getSourceRangeOffsets().

## ◆ Change

ChangeKind clang::diff::Node::Change = None

Definition at line 42 of file ASTDiff.h.

Referenced by clang::diff::ASTDiff::Impl::computeChangeKinds().

## ◆ Children

SmallVector<NodeId, 4> clang::diff::Node::Children

Definition at line 41 of file ASTDiff.h.

Referenced by clang::diff::SyntaxTree::Impl::findPositionInParent(), clang::diff::getSubtreeBfs(), and clang::diff::getSubtreePostorder().

## ◆ Depth

int clang::diff::Node::Depth

Definition at line 39 of file ASTDiff.h.

## ◆ Height

int clang::diff::Node::Height

Definition at line 39 of file ASTDiff.h.

Referenced by getIdentifier().

## ◆ LeftMostDescendant

NodeId clang::diff::Node::LeftMostDescendant

Definition at line 38 of file ASTDiff.h.

Referenced by clang::diff::Subtree::getNodeValue(), and clang::diff::getSubtreeBfs().

## ◆ Parent

NodeId clang::diff::Node::Parent

Definition at line 38 of file ASTDiff.h.

Referenced by clang::diff::SyntaxTree::Impl::findPositionInParent().

## ◆ RightMostDescendant

NodeId clang::diff::Node::RightMostDescendant

Definition at line 38 of file ASTDiff.h.

Referenced by clang::diff::SyntaxTree::Impl::getNumberOfDescendants(), and clang::diff::SyntaxTree::Impl::isInSubtree().

## ◆ Shift

int clang::diff::Node::Shift = 0

Definition at line 39 of file ASTDiff.h.

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

- include/clang/Tooling/ASTDiff/ASTDiff.h
- lib/Tooling/ASTDiff/ASTDiff.cpp