/src/llvm-project/llvm/lib/Support/SuffixTreeNode.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===- llvm/ADT/SuffixTreeNode.cpp - Nodes for SuffixTrees --------*- C++ |
2 | | //-*-===// |
3 | | // |
4 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
5 | | // See https://llvm.org/LICENSE.txt for license information. |
6 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
7 | | // |
8 | | //===----------------------------------------------------------------------===// |
9 | | // |
10 | | // This file defines nodes for use within a SuffixTree. |
11 | | // |
12 | | //===----------------------------------------------------------------------===// |
13 | | |
14 | | #include "llvm/Support/SuffixTreeNode.h" |
15 | | #include "llvm/Support/Casting.h" |
16 | | |
17 | | using namespace llvm; |
18 | | |
19 | 13.1k | unsigned SuffixTreeNode::getStartIdx() const { return StartIdx; } |
20 | 3 | void SuffixTreeNode::incrementStartIdx(unsigned Inc) { StartIdx += Inc; } |
21 | 12.9k | void SuffixTreeNode::setConcatLen(unsigned Len) { ConcatLen = Len; } |
22 | 12.7k | unsigned SuffixTreeNode::getConcatLen() const { return ConcatLen; } |
23 | | |
24 | 12.9k | bool SuffixTreeInternalNode::isRoot() const { |
25 | 12.9k | return getStartIdx() == EmptyIdx; |
26 | 12.9k | } |
27 | 3 | unsigned SuffixTreeInternalNode::getEndIdx() const { return EndIdx; } |
28 | 3 | void SuffixTreeInternalNode::setLink(SuffixTreeInternalNode *L) { |
29 | 3 | assert(L && "Cannot set a null link?"); |
30 | 0 | Link = L; |
31 | 3 | } |
32 | 0 | SuffixTreeInternalNode *SuffixTreeInternalNode::getLink() const { return Link; } |
33 | | |
34 | 194 | unsigned SuffixTreeLeafNode::getEndIdx() const { |
35 | 194 | assert(EndIdx && "EndIdx is empty?"); |
36 | 0 | return *EndIdx; |
37 | 194 | } |
38 | | |
39 | 0 | unsigned SuffixTreeLeafNode::getSuffixIdx() const { return SuffixIdx; } |
40 | 188 | void SuffixTreeLeafNode::setSuffixIdx(unsigned Idx) { SuffixIdx = Idx; } |