clang: include/clang/Tooling/ASTDiff/ASTDiff.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#ifndef LLVM_CLANG_TOOLING_ASTDIFF_ASTDIFF_H
20#define LLVM_CLANG_TOOLING_ASTDIFF_ASTDIFF_H
21
23#include
24
27
36
37
51
52
53
55public:
56
58
59 template
64
67
73
76
77
79
80
81
82
85
88};
89
91
93
94
95
97
98
99
101
103
104
108};
109
111public:
114
115
117
119
120private:
121 std::unique_ptr DiffImpl;
122};
123
124}
125}
126
127#endif
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
constexpr bool isSame(ASTNodeKind Other) const
Returns true if this and Other represent the same kind.
ASTDiff(SyntaxTree &Src, SyntaxTree &Dst, const ComparisonOptions &Options)
NodeId getMapped(const SyntaxTree &SourceTree, NodeId Id) const
Represents the AST of a TranslationUnit.
SyntaxTree objects represent subtrees of the AST.
Definition ASTDiff.h:54
NodeId PreorderIterator
Definition ASTDiff.h:70
const Node & getNode(NodeId Id) const
StringRef getFilename() const
int findPositionInParent(NodeId Id) const
SyntaxTree(SyntaxTree &&Other)=default
const ASTContext & getASTContext() const
PreorderIterator begin() const
std::pair< unsigned, unsigned > getSourceRangeOffsets(const Node &N) const
SyntaxTree(ASTContext &AST)
Constructs a tree from a translation unit.
std::unique_ptr< Impl > TreeImpl
Definition ASTDiff.h:87
SyntaxTree(T *Node, ASTContext &AST)
Constructs a tree from any AST node.
Definition ASTDiff.h:60
PreorderIterator end() const
std::string getNodeValue(NodeId Id) const
Serialize the node attributes to a string representation.
ChangeKind
Definition ASTDiff.h:28
@ Delete
Definition ASTDiff.h:30
@ None
Definition ASTDiff.h:29
@ Update
Definition ASTDiff.h:31
@ UpdateMove
Definition ASTDiff.h:34
@ Move
Definition ASTDiff.h:33
@ Insert
Definition ASTDiff.h:32
DynTypedNode DynTypedNode
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
@ Other
Other implicit parameter.
int MinHeight
During top-down matching, only consider nodes of at least this height.
Definition ASTDiff.h:92
double MinSimilarity
During bottom-up matching, match only nodes with at least this value as the ratio of their common des...
Definition ASTDiff.h:96
bool isMatchingAllowed(const Node &N1, const Node &N2) const
Returns false if the nodes should never be matched.
Definition ASTDiff.h:105
bool StopAfterTopDown
Definition ASTDiff.h:102
int MaxSize
Whenever two subtrees are matched in the bottom-up phase, the optimal mapping is computed,...
Definition ASTDiff.h:100
Within a tree, this identifies a node by its preorder offset.
Represents a Clang AST node, alongside some additional information.
Definition ASTDiff.h:38
NodeId Parent
Definition ASTDiff.h:39
NodeId RightMostDescendant
Definition ASTDiff.h:39
int Depth
Definition ASTDiff.h:40
bool isLeaf() const
Definition ASTDiff.h:47
int Shift
Definition ASTDiff.h:40
ChangeKind Change
Definition ASTDiff.h:43
std::optional< std::string > getQualifiedIdentifier() const
std::optional< StringRef > getIdentifier() const
ASTNodeKind getType() const
NodeId LeftMostDescendant
Definition ASTDiff.h:39
StringRef getTypeLabel() const
int Height
Definition ASTDiff.h:40
DynTypedNode ASTNode
Definition ASTDiff.h:41
SmallVector< NodeId, 4 > Children
Definition ASTDiff.h:42