LLVM: include/llvm/Support/SuffixTreeNode.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26#ifndef LLVM_SUPPORT_SUFFIXTREE_NODE_H
27#define LLVM_SUPPORT_SUFFIXTREE_NODE_H
30
31namespace llvm {
32
33
35public:
36
39
40private:
42
43
45
46
47
48 unsigned ConcatLen = 0;
49
50
51
52
53
54
55
56
57
58 unsigned LeftLeafIdx = EmptyIdx;
59 unsigned RightLeafIdx = EmptyIdx;
60
61public:
62
64
65
67
68
70
71
73
74
76
77
79
80
82
83
85
86
88
89
91
93 : Kind(Kind), StartIdx(StartIdx) {}
95};
96
97
99private:
100
101
102
103
104
105
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
127
128public:
129
133
134
135 bool isRoot() const;
136
137
138 unsigned getEndIdx() const override;
139
140
142
143
145
146
147
148
149
150
152
157
159};
160
161
163private:
164
165 unsigned SuffixIdx = EmptyIdx;
166
167
168
169
170
171
172
173 unsigned *EndIdx = nullptr;
174
175public:
176
180
181
182 unsigned getEndIdx() const override;
183
184
185 unsigned getSuffixIdx() const;
186
187
188 void setSuffixIdx(unsigned Idx);
191
193};
194}
195#endif
This file defines the DenseMap class.
This is an optimization pass for GlobalISel generic memory operations.
Determine the kind of a node from its type.
Definition SuffixTreeNode.h:98
DenseMap< unsigned, SuffixTreeNode * > Children
The children of this node.
Definition SuffixTreeNode.h:151
static bool classof(const SuffixTreeNode *N)
Definition SuffixTreeNode.h:130
SuffixTreeInternalNode(unsigned StartIdx, unsigned EndIdx, SuffixTreeInternalNode *Link)
Definition SuffixTreeNode.h:153
~SuffixTreeInternalNode() override=default
~SuffixTreeLeafNode() override=default
static bool classof(const SuffixTreeNode *N)
Definition SuffixTreeNode.h:177
SuffixTreeLeafNode(unsigned StartIdx, unsigned *EndIdx)
Definition SuffixTreeNode.h:189
LLVM_ABI void incrementStartIdx(unsigned Inc)
Advance this node's StartIdx by Inc.
NodeKind getKind() const
Definition SuffixTreeNode.h:63
LLVM_ABI void setConcatLen(unsigned Len)
Set the length of the string from the root to this node to Len.
LLVM_ABI unsigned getLeftLeafIdx() const
virtual ~SuffixTreeNode()=default
LLVM_ABI unsigned getRightLeafIdx() const
LLVM_ABI void setRightLeafIdx(unsigned Idx)
Set the index of the right most leaf node of this node to Idx.
SuffixTreeNode(NodeKind Kind, unsigned StartIdx)
Definition SuffixTreeNode.h:92
LLVM_ABI unsigned getConcatLen() const
static const unsigned EmptyIdx
Represents an undefined index in the suffix tree.
Definition SuffixTreeNode.h:37
LLVM_ABI unsigned getStartIdx() const
LLVM_ABI void setLeftLeafIdx(unsigned Idx)
Set the index of the left most leaf node of this node to Idx.
virtual unsigned getEndIdx() const =0
NodeKind
Definition SuffixTreeNode.h:38
@ ST_Internal
Definition SuffixTreeNode.h:38
@ ST_Leaf
Definition SuffixTreeNode.h:38