32#ifndef LLVM_SUPPORT_SUFFIXTREE_H
33#define LLVM_SUPPORT_SUFFIXTREE_H
109 unsigned StartIdx,
unsigned EndIdx,
119 void setSuffixIndices();
135 unsigned extend(
unsigned EndIdx,
unsigned SuffixesToAdd);
141 std::vector<SuffixTreeLeafNode *> LeafNodes;
175 const unsigned MinLength = 2;
178 const std::vector<SuffixTreeLeafNode *> &LeafNodes;
181 bool OutlinerLeafDescendants = !LeafNodes.
empty();
205 return !(*
this ==
Other);
210 const std::vector<SuffixTreeLeafNode *> &LeafNodes = {})
211 :
N(
N), LeafNodes(LeafNodes) {
This file defines the BumpPtrAllocator interface.
static cl::opt< bool > OutlinerLeafDescendants("outliner-leaf-descendants", cl::init(true), cl::Hidden, cl::desc("Consider all leaf descendants of internal nodes of the suffix " "tree as candidates for outlining (if false, only leaf children " "are considered)"))
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
A BumpPtrAllocator that allows only elements of a specific type to be allocated.
LLVM_ABI SuffixTree(const ArrayRef< unsigned > &Str, bool OutlinerLeafDescendants=false)
Construct a suffix tree from a sequence of unsigned integers.
ArrayRef< unsigned > Str
Each element is an integer representing an instruction in the module.
RepeatedSubstringIterator iterator
bool OutlinerLeafDescendants
Whether to consider leaf descendants or only leaf children.
This is an optimization pass for GlobalISel generic memory operations.
A node in a suffix tree which represents a substring or suffix.
static const unsigned EmptyIdx
Represents an undefined index in the suffix tree.
Iterator for finding all repeated substrings in the suffix tree.
RepeatedSubstringIterator operator++(int I)
RepeatedSubstringIterator(SuffixTreeInternalNode *N, const std::vector< SuffixTreeLeafNode * > &LeafNodes={})
bool operator!=(const RepeatedSubstringIterator &Other) const
RepeatedSubstring & operator*()
Return the current repeated substring.
bool operator==(const RepeatedSubstringIterator &Other) const
RepeatedSubstringIterator & operator++()
A repeated substring in the tree.
SmallVector< unsigned > StartIndices
The start indices of each occurrence.
unsigned Length
The length of the string.