Coverage Report

Created: 2018-09-25 17:16

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/ADT/SmallString.h
Line
Count
Source (jump to first uncovered line)
1
//===- llvm/ADT/SmallString.h - 'Normally small' strings --------*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// This file defines the SmallString class.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_ADT_SMALLSTRING_H
15
#define LLVM_ADT_SMALLSTRING_H
16
17
#include "llvm/ADT/SmallVector.h"
18
#include "llvm/ADT/StringRef.h"
19
#include <cstddef>
20
21
namespace llvm {
22
23
/// SmallString - A SmallString is just a SmallVector with methods and accessors
24
/// that make it work better as a string (e.g. operator+ etc).
25
template<unsigned InternalLen>
26
class SmallString : public SmallVector<char, InternalLen> {
27
public:
28
  /// Default ctor - Initialize to empty.
29
234M
  SmallString() = default;
llvm::SmallString<128u>::SmallString()
Line
Count
Source
29
57.8M
  SmallString() = default;
llvm::SmallString<64u>::SmallString()
Line
Count
Source
29
16.0M
  SmallString() = default;
llvm::SmallString<40u>::SmallString()
Line
Count
Source
29
2.76M
  SmallString() = default;
llvm::SmallString<60u>::SmallString()
Line
Count
Source
29
60.0k
  SmallString() = default;
llvm::SmallString<256u>::SmallString()
Line
Count
Source
29
76.1M
  SmallString() = default;
llvm::SmallString<32u>::SmallString()
Line
Count
Source
29
50.9M
  SmallString() = default;
llvm::SmallString<512u>::SmallString()
Line
Count
Source
29
10.5M
  SmallString() = default;
llvm::SmallString<16u>::SmallString()
Line
Count
Source
29
15.6M
  SmallString() = default;
llvm::SmallString<126u>::SmallString()
Line
Count
Source
29
22
  SmallString() = default;
llvm::SmallString<24u>::SmallString()
Line
Count
Source
29
94
  SmallString() = default;
llvm::SmallString<2048u>::SmallString()
Line
Count
Source
29
1.67k
  SmallString() = default;
llvm::SmallString<8u>::SmallString()
Line
Count
Source
29
255k
  SmallString() = default;
llvm::SmallString<0u>::SmallString()
Line
Count
Source
29
31.9k
  SmallString() = default;
llvm::SmallString<16384u>::SmallString()
Line
Count
Source
29
33.5k
  SmallString() = default;
llvm::SmallString<4u>::SmallString()
Line
Count
Source
29
100
  SmallString() = default;
llvm::SmallString<20u>::SmallString()
Line
Count
Source
29
842
  SmallString() = default;
llvm::SmallString<4096u>::SmallString()
Line
Count
Source
29
19.7k
  SmallString() = default;
llvm::SmallString<10u>::SmallString()
Line
Count
Source
29
47.6k
  SmallString() = default;
llvm::SmallString<5u>::SmallString()
Line
Count
Source
29
120
  SmallString() = default;
llvm::SmallString<36u>::SmallString()
Line
Count
Source
29
32
  SmallString() = default;
llvm::SmallString<1024u>::SmallString()
Line
Count
Source
29
3.77M
  SmallString() = default;
llvm::SmallString<100u>::SmallString()
Line
Count
Source
29
229k
  SmallString() = default;
llvm::SmallString<200u>::SmallString()
Line
Count
Source
29
1.58k
  SmallString() = default;
llvm::SmallString<80u>::SmallString()
Line
Count
Source
29
172
  SmallString() = default;
llvm::SmallString<120u>::SmallString()
Line
Count
Source
29
46
  SmallString() = default;
llvm::SmallString<192u>::SmallString()
Line
Count
Source
29
87
  SmallString() = default;
llvm::SmallString<70u>::SmallString()
Line
Count
Source
29
8
  SmallString() = default;
llvm::SmallString<320u>::SmallString()
Line
Count
Source
29
16
  SmallString() = default;
llvm::SmallString<50u>::SmallString()
Line
Count
Source
29
232
  SmallString() = default;
llvm::SmallString<136u>::SmallString()
Line
Count
Source
29
871
  SmallString() = default;
llvm::SmallString<2u>::SmallString()
Line
Count
Source
29
27
  SmallString() = default;
llvm::SmallString<42u>::SmallString()
Line
Count
Source
29
25
  SmallString() = default;
llvm::SmallString<1u>::SmallString()
Line
Count
Source
29
36
  SmallString() = default;
30
31
  /// Initialize from a StringRef.
32
22.7M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<128u>::SmallString(llvm::StringRef)
Line
Count
Source
32
4.94M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<256u>::SmallString(llvm::StringRef)
Line
Count
Source
32
883k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<64u>::SmallString(llvm::StringRef)
Line
Count
Source
32
250k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<32u>::SmallString(llvm::StringRef)
Line
Count
Source
32
24.8k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<16u>::SmallString(llvm::StringRef)
Line
Count
Source
32
268
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<8u>::SmallString(llvm::StringRef)
Line
Count
Source
32
4.25k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<20u>::SmallString(llvm::StringRef)
Line
Count
Source
32
89
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<1024u>::SmallString(llvm::StringRef)
Line
Count
Source
32
4.31k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<23u>::SmallString(llvm::StringRef)
Line
Count
Source
32
12
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<261u>::SmallString(llvm::StringRef)
Line
Count
Source
32
7
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<512u>::SmallString(llvm::StringRef)
Line
Count
Source
32
143
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<200u>::SmallString(llvm::StringRef)
Line
Count
Source
32
69
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<80u>::SmallString(llvm::StringRef)
Line
Count
Source
32
16.6M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<100u>::SmallString(llvm::StringRef)
Line
Count
Source
32
552
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<10u>::SmallString(llvm::StringRef)
Line
Count
Source
32
136
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<40u>::SmallString(llvm::StringRef)
Line
Count
Source
32
1.70k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
33
34
  /// Initialize with a range.
35
  template<typename ItTy>
36
4.73M
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<256u>::SmallString<char const*>(char const*, char const*)
Line
Count
Source
36
1.19M
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
Unexecuted instantiation: llvm::SmallString<128u>::SmallString<char const*>(char const*, char const*)
llvm::SmallString<16u>::SmallString<unsigned char const*>(unsigned char const*, unsigned char const*)
Line
Count
Source
36
3.11M
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<16u>::SmallString<unsigned long long const*>(unsigned long long const*, unsigned long long const*)
Line
Count
Source
36
197
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<128u>::SmallString<unsigned long long*>(unsigned long long*, unsigned long long*)
Line
Count
Source
36
492
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<1024u>::SmallString<char const*>(char const*, char const*)
Line
Count
Source
36
143
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<32u>::SmallString<char const*>(char const*, char const*)
Line
Count
Source
36
431
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<16u>::SmallString<unsigned long long*>(unsigned long long*, unsigned long long*)
Line
Count
Source
36
248k
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<8u>::SmallString<unsigned long long*>(unsigned long long*, unsigned long long*)
Line
Count
Source
36
171k
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
37
38
  // Note that in order to add new overloads for append & assign, we have to
39
  // duplicate the inherited versions so as not to inadvertently hide them.
40
41
  /// @}
42
  /// @name String Assignment
43
  /// @{
44
45
  /// Assign from a repeated element.
46
3.34k
  void assign(size_t NumElts, char Elt) {
47
3.34k
    this->SmallVectorImpl<char>::assign(NumElts, Elt);
48
3.34k
  }
49
50
  /// Assign from an iterator pair.
51
  template<typename in_iter>
52
  void assign(in_iter S, in_iter E) {
53
    this->clear();
54
    SmallVectorImpl<char>::append(S, E);
55
  }
56
57
  /// Assign from a StringRef.
58
58.7k
  void assign(StringRef RHS) {
59
58.7k
    this->clear();
60
58.7k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
61
58.7k
  }
llvm::SmallString<128u>::assign(llvm::StringRef)
Line
Count
Source
58
57.4k
  void assign(StringRef RHS) {
59
57.4k
    this->clear();
60
57.4k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
61
57.4k
  }
llvm::SmallString<32u>::assign(llvm::StringRef)
Line
Count
Source
58
1.29k
  void assign(StringRef RHS) {
59
1.29k
    this->clear();
60
1.29k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
61
1.29k
  }
llvm::SmallString<256u>::assign(llvm::StringRef)
Line
Count
Source
58
53
  void assign(StringRef RHS) {
59
53
    this->clear();
60
53
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
61
53
  }
62
63
  /// Assign from a SmallVector.
64
1
  void assign(const SmallVectorImpl<char> &RHS) {
65
1
    this->clear();
66
1
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
67
1
  }
68
69
  /// @}
70
  /// @name String Concatenation
71
  /// @{
72
73
  /// Append from an iterator pair.
74
  template<typename in_iter>
75
24.5M
  void append(in_iter S, in_iter E) {
76
24.5M
    SmallVectorImpl<char>::append(S, E);
77
24.5M
  }
void llvm::SmallString<128u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
1.37M
  void append(in_iter S, in_iter E) {
76
1.37M
    SmallVectorImpl<char>::append(S, E);
77
1.37M
  }
void llvm::SmallString<256u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
31.5k
  void append(in_iter S, in_iter E) {
76
31.5k
    SmallVectorImpl<char>::append(S, E);
77
31.5k
  }
void llvm::SmallString<512u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
8.62M
  void append(in_iter S, in_iter E) {
76
8.62M
    SmallVectorImpl<char>::append(S, E);
77
8.62M
  }
void llvm::SmallString<16u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
53.2k
  void append(in_iter S, in_iter E) {
76
53.2k
    SmallVectorImpl<char>::append(S, E);
77
53.2k
  }
void llvm::SmallString<64u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
11.9M
  void append(in_iter S, in_iter E) {
76
11.9M
    SmallVectorImpl<char>::append(S, E);
77
11.9M
  }
void llvm::SmallString<32u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
481k
  void append(in_iter S, in_iter E) {
76
481k
    SmallVectorImpl<char>::append(S, E);
77
481k
  }
void llvm::SmallString<8u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
12.4k
  void append(in_iter S, in_iter E) {
76
12.4k
    SmallVectorImpl<char>::append(S, E);
77
12.4k
  }
Unexecuted instantiation: void llvm::SmallString<128u>::append<char*>(char*, char*)
void llvm::SmallString<20u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
677
  void append(in_iter S, in_iter E) {
76
677
    SmallVectorImpl<char>::append(S, E);
77
677
  }
void llvm::SmallString<23u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
12
  void append(in_iter S, in_iter E) {
76
12
    SmallVectorImpl<char>::append(S, E);
77
12
  }
void llvm::SmallString<24u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
121
  void append(in_iter S, in_iter E) {
76
121
    SmallVectorImpl<char>::append(S, E);
77
121
  }
void llvm::SmallString<1024u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
1.98M
  void append(in_iter S, in_iter E) {
76
1.98M
    SmallVectorImpl<char>::append(S, E);
77
1.98M
  }
void llvm::SmallString<40u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
73
  void append(in_iter S, in_iter E) {
76
73
    SmallVectorImpl<char>::append(S, E);
77
73
  }
void llvm::SmallString<80u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
6
  void append(in_iter S, in_iter E) {
76
6
    SmallVectorImpl<char>::append(S, E);
77
6
  }
void llvm::SmallString<42u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
239
  void append(in_iter S, in_iter E) {
76
239
    SmallVectorImpl<char>::append(S, E);
77
239
  }
void llvm::SmallString<4096u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
3.49k
  void append(in_iter S, in_iter E) {
76
3.49k
    SmallVectorImpl<char>::append(S, E);
77
3.49k
  }
void llvm::SmallString<10u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
270
  void append(in_iter S, in_iter E) {
76
270
    SmallVectorImpl<char>::append(S, E);
77
270
  }
void llvm::SmallString<128u>::append<std::__1::__wrap_iter<char*> >(std::__1::__wrap_iter<char*>, std::__1::__wrap_iter<char*>)
Line
Count
Source
75
3.76k
  void append(in_iter S, in_iter E) {
76
3.76k
    SmallVectorImpl<char>::append(S, E);
77
3.76k
  }
void llvm::SmallString<60u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
28.0k
  void append(in_iter S, in_iter E) {
76
28.0k
    SmallVectorImpl<char>::append(S, E);
77
28.0k
  }
78
79
102k
  void append(size_t NumInputs, char Elt) {
80
102k
    SmallVectorImpl<char>::append(NumInputs, Elt);
81
102k
  }
llvm::SmallString<128u>::append(unsigned long, char)
Line
Count
Source
79
29
  void append(size_t NumInputs, char Elt) {
80
29
    SmallVectorImpl<char>::append(NumInputs, Elt);
81
29
  }
llvm::SmallString<256u>::append(unsigned long, char)
Line
Count
Source
79
102k
  void append(size_t NumInputs, char Elt) {
80
102k
    SmallVectorImpl<char>::append(NumInputs, Elt);
81
102k
  }
82
83
  /// Append from a StringRef.
84
770k
  void append(StringRef RHS) {
85
770k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
770k
  }
llvm::SmallString<128u>::append(llvm::StringRef)
Line
Count
Source
84
662k
  void append(StringRef RHS) {
85
662k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
662k
  }
llvm::SmallString<256u>::append(llvm::StringRef)
Line
Count
Source
84
107k
  void append(StringRef RHS) {
85
107k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
107k
  }
llvm::SmallString<64u>::append(llvm::StringRef)
Line
Count
Source
84
38
  void append(StringRef RHS) {
85
38
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
38
  }
llvm::SmallString<8u>::append(llvm::StringRef)
Line
Count
Source
84
76
  void append(StringRef RHS) {
85
76
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
76
  }
llvm::SmallString<32u>::append(llvm::StringRef)
Line
Count
Source
84
370
  void append(StringRef RHS) {
85
370
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
370
  }
llvm::SmallString<16u>::append(llvm::StringRef)
Line
Count
Source
84
82
  void append(StringRef RHS) {
85
82
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
82
  }
87
88
  /// Append from a SmallVector.
89
61
  void append(const SmallVectorImpl<char> &RHS) {
90
61
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
91
61
  }
92
93
  /// @}
94
  /// @name String Comparison
95
  /// @{
96
97
  /// Check for string equality.  This is more efficient than compare() when
98
  /// the relative ordering of inequal strings isn't needed.
99
0
  bool equals(StringRef RHS) const {
100
0
    return str().equals(RHS);
101
0
  }
102
103
  /// Check for string equality, ignoring case.
104
  bool equals_lower(StringRef RHS) const {
105
    return str().equals_lower(RHS);
106
  }
107
108
  /// Compare two strings; the result is -1, 0, or 1 if this string is
109
  /// lexicographically less than, equal to, or greater than the \p RHS.
110
  int compare(StringRef RHS) const {
111
    return str().compare(RHS);
112
  }
113
114
  /// compare_lower - Compare two strings, ignoring case.
115
  int compare_lower(StringRef RHS) const {
116
    return str().compare_lower(RHS);
117
  }
118
119
  /// compare_numeric - Compare two strings, treating sequences of digits as
120
  /// numbers.
121
  int compare_numeric(StringRef RHS) const {
122
    return str().compare_numeric(RHS);
123
  }
124
125
  /// @}
126
  /// @name String Predicates
127
  /// @{
128
129
  /// startswith - Check if this string starts with the given \p Prefix.
130
609
  bool startswith(StringRef Prefix) const {
131
609
    return str().startswith(Prefix);
132
609
  }
llvm::SmallString<128u>::startswith(llvm::StringRef) const
Line
Count
Source
130
421
  bool startswith(StringRef Prefix) const {
131
421
    return str().startswith(Prefix);
132
421
  }
llvm::SmallString<64u>::startswith(llvm::StringRef) const
Line
Count
Source
130
188
  bool startswith(StringRef Prefix) const {
131
188
    return str().startswith(Prefix);
132
188
  }
133
134
  /// endswith - Check if this string ends with the given \p Suffix.
135
7.92k
  bool endswith(StringRef Suffix) const {
136
7.92k
    return str().endswith(Suffix);
137
7.92k
  }
138
139
  /// @}
140
  /// @name String Searching
141
  /// @{
142
143
  /// find - Search for the first character \p C in the string.
144
  ///
145
  /// \return - The index of the first occurrence of \p C, or npos if not
146
  /// found.
147
  size_t find(char C, size_t From = 0) const {
148
    return str().find(C, From);
149
  }
150
151
  /// Search for the first string \p Str in the string.
152
  ///
153
  /// \returns The index of the first occurrence of \p Str, or npos if not
154
  /// found.
155
  size_t find(StringRef Str, size_t From = 0) const {
156
    return str().find(Str, From);
157
  }
158
159
  /// Search for the last character \p C in the string.
160
  ///
161
  /// \returns The index of the last occurrence of \p C, or npos if not
162
  /// found.
163
  size_t rfind(char C, size_t From = StringRef::npos) const {
164
    return str().rfind(C, From);
165
  }
166
167
  /// Search for the last string \p Str in the string.
168
  ///
169
  /// \returns The index of the last occurrence of \p Str, or npos if not
170
  /// found.
171
  size_t rfind(StringRef Str) const {
172
    return str().rfind(Str);
173
  }
174
175
  /// Find the first character in the string that is \p C, or npos if not
176
  /// found. Same as find.
177
  size_t find_first_of(char C, size_t From = 0) const {
178
    return str().find_first_of(C, From);
179
  }
180
181
  /// Find the first character in the string that is in \p Chars, or npos if
182
  /// not found.
183
  ///
184
  /// Complexity: O(size() + Chars.size())
185
6
  size_t find_first_of(StringRef Chars, size_t From = 0) const {
186
6
    return str().find_first_of(Chars, From);
187
6
  }
188
189
  /// Find the first character in the string that is not \p C or npos if not
190
  /// found.
191
  size_t find_first_not_of(char C, size_t From = 0) const {
192
    return str().find_first_not_of(C, From);
193
  }
194
195
  /// Find the first character in the string that is not in the string
196
  /// \p Chars, or npos if not found.
197
  ///
198
  /// Complexity: O(size() + Chars.size())
199
106
  size_t find_first_not_of(StringRef Chars, size_t From = 0) const {
200
106
    return str().find_first_not_of(Chars, From);
201
106
  }
202
203
  /// Find the last character in the string that is \p C, or npos if not
204
  /// found.
205
  size_t find_last_of(char C, size_t From = StringRef::npos) const {
206
    return str().find_last_of(C, From);
207
  }
208
209
  /// Find the last character in the string that is in \p C, or npos if not
210
  /// found.
211
  ///
212
  /// Complexity: O(size() + Chars.size())
213
  size_t find_last_of(
214
      StringRef Chars, size_t From = StringRef::npos) const {
215
    return str().find_last_of(Chars, From);
216
  }
217
218
  /// @}
219
  /// @name Helpful Algorithms
220
  /// @{
221
222
  /// Return the number of occurrences of \p C in the string.
223
  size_t count(char C) const {
224
    return str().count(C);
225
  }
226
227
  /// Return the number of non-overlapped occurrences of \p Str in the
228
  /// string.
229
  size_t count(StringRef Str) const {
230
    return str().count(Str);
231
  }
232
233
  /// @}
234
  /// @name Substring Operations
235
  /// @{
236
237
  /// Return a reference to the substring from [Start, Start + N).
238
  ///
239
  /// \param Start The index of the starting character in the substring; if
240
  /// the index is npos or greater than the length of the string then the
241
  /// empty substring will be returned.
242
  ///
243
  /// \param N The number of characters to included in the substring. If \p N
244
  /// exceeds the number of characters remaining in the string, the string
245
  /// suffix (starting with \p Start) will be returned.
246
4.00k
  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
247
4.00k
    return str().substr(Start, N);
248
4.00k
  }
llvm::SmallString<256u>::substr(unsigned long, unsigned long) const
Line
Count
Source
246
3.73k
  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
247
3.73k
    return str().substr(Start, N);
248
3.73k
  }
llvm::SmallString<128u>::substr(unsigned long, unsigned long) const
Line
Count
Source
246
268
  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
247
268
    return str().substr(Start, N);
248
268
  }
249
250
  /// Return a reference to the substring from [Start, End).
251
  ///
252
  /// \param Start The index of the starting character in the substring; if
253
  /// the index is npos or greater than the length of the string then the
254
  /// empty substring will be returned.
255
  ///
256
  /// \param End The index following the last character to include in the
257
  /// substring. If this is npos, or less than \p Start, or exceeds the
258
  /// number of characters remaining in the string, the string suffix
259
  /// (starting with \p Start) will be returned.
260
4.30M
  StringRef slice(size_t Start, size_t End) const {
261
4.30M
    return str().slice(Start, End);
262
4.30M
  }
263
264
  // Extra methods.
265
266
  /// Explicit conversion to StringRef.
267
67.8M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<128u>::str() const
Line
Count
Source
267
22.2M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<256u>::str() const
Line
Count
Source
267
1.90M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<512u>::str() const
Line
Count
Source
267
8.62M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<16u>::str() const
Line
Count
Source
267
3.40M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<24u>::str() const
Line
Count
Source
267
72
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<32u>::str() const
Line
Count
Source
267
4.94M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<64u>::str() const
Line
Count
Source
267
21.0M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<8u>::str() const
Line
Count
Source
267
177k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<0u>::str() const
Line
Count
Source
267
12.9k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<40u>::str() const
Line
Count
Source
267
1.56M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<16384u>::str() const
Line
Count
Source
267
33.5k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
Unexecuted instantiation: llvm::SmallString<2048u>::str() const
llvm::SmallString<20u>::str() const
Line
Count
Source
267
648
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<4096u>::str() const
Line
Count
Source
267
19.6k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<1024u>::str() const
Line
Count
Source
267
3.73M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<36u>::str() const
Line
Count
Source
267
32
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<23u>::str() const
Line
Count
Source
267
12
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<100u>::str() const
Line
Count
Source
267
198k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<200u>::str() const
Line
Count
Source
267
28
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<50u>::str() const
Line
Count
Source
267
133
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<136u>::str() const
Line
Count
Source
267
871
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<2u>::str() const
Line
Count
Source
267
27
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<10u>::str() const
Line
Count
Source
267
429
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<5u>::str() const
Line
Count
Source
267
60
  StringRef str() const { return StringRef(this->begin(), this->size()); }
268
269
  // TODO: Make this const, if it's safe...
270
579k
  const char* c_str() {
271
579k
    this->push_back(0);
272
579k
    this->pop_back();
273
579k
    return this->data();
274
579k
  }
llvm::SmallString<8u>::c_str()
Line
Count
Source
270
33.6k
  const char* c_str() {
271
33.6k
    this->push_back(0);
272
33.6k
    this->pop_back();
273
33.6k
    return this->data();
274
33.6k
  }
llvm::SmallString<128u>::c_str()
Line
Count
Source
270
545k
  const char* c_str() {
271
545k
    this->push_back(0);
272
545k
    this->pop_back();
273
545k
    return this->data();
274
545k
  }
llvm::SmallString<24u>::c_str()
Line
Count
Source
270
29
  const char* c_str() {
271
29
    this->push_back(0);
272
29
    this->pop_back();
273
29
    return this->data();
274
29
  }
Unexecuted instantiation: llvm::SmallString<2048u>::c_str()
llvm::SmallString<32u>::c_str()
Line
Count
Source
270
559
  const char* c_str() {
271
559
    this->push_back(0);
272
559
    this->pop_back();
273
559
    return this->data();
274
559
  }
llvm::SmallString<256u>::c_str()
Line
Count
Source
270
336
  const char* c_str() {
271
336
    this->push_back(0);
272
336
    this->pop_back();
273
336
    return this->data();
274
336
  }
Unexecuted instantiation: llvm::SmallString<16u>::c_str()
llvm::SmallString<80u>::c_str()
Line
Count
Source
270
3
  const char* c_str() {
271
3
    this->push_back(0);
272
3
    this->pop_back();
273
3
    return this->data();
274
3
  }
llvm::SmallString<1024u>::c_str()
Line
Count
Source
270
1
  const char* c_str() {
271
1
    this->push_back(0);
272
1
    this->pop_back();
273
1
    return this->data();
274
1
  }
275
276
  /// Implicit conversion to StringRef.
277
58.9M
  operator StringRef() const { return str(); }
llvm::SmallString<128u>::operator llvm::StringRef() const
Line
Count
Source
277
21.3M
  operator StringRef() const { return str(); }
llvm::SmallString<256u>::operator llvm::StringRef() const
Line
Count
Source
277
1.33M
  operator StringRef() const { return str(); }
llvm::SmallString<32u>::operator llvm::StringRef() const
Line
Count
Source
277
4.94M
  operator StringRef() const { return str(); }
llvm::SmallString<512u>::operator llvm::StringRef() const
Line
Count
Source
277
4.31M
  operator StringRef() const { return str(); }
llvm::SmallString<16u>::operator llvm::StringRef() const
Line
Count
Source
277
2.36M
  operator StringRef() const { return str(); }
llvm::SmallString<24u>::operator llvm::StringRef() const
Line
Count
Source
277
72
  operator StringRef() const { return str(); }
llvm::SmallString<64u>::operator llvm::StringRef() const
Line
Count
Source
277
20.8M
  operator StringRef() const { return str(); }
llvm::SmallString<8u>::operator llvm::StringRef() const
Line
Count
Source
277
16.2k
  operator StringRef() const { return str(); }
llvm::SmallString<16384u>::operator llvm::StringRef() const
Line
Count
Source
277
33.5k
  operator StringRef() const { return str(); }
llvm::SmallString<20u>::operator llvm::StringRef() const
Line
Count
Source
277
604
  operator StringRef() const { return str(); }
llvm::SmallString<4096u>::operator llvm::StringRef() const
Line
Count
Source
277
19.6k
  operator StringRef() const { return str(); }
llvm::SmallString<23u>::operator llvm::StringRef() const
Line
Count
Source
277
12
  operator StringRef() const { return str(); }
llvm::SmallString<1024u>::operator llvm::StringRef() const
Line
Count
Source
277
3.72M
  operator StringRef() const { return str(); }
llvm::SmallString<40u>::operator llvm::StringRef() const
Line
Count
Source
277
6.78k
  operator StringRef() const { return str(); }
llvm::SmallString<100u>::operator llvm::StringRef() const
Line
Count
Source
277
1.17k
  operator StringRef() const { return str(); }
llvm::SmallString<50u>::operator llvm::StringRef() const
Line
Count
Source
277
133
  operator StringRef() const { return str(); }
llvm::SmallString<136u>::operator llvm::StringRef() const
Line
Count
Source
277
871
  operator StringRef() const { return str(); }
llvm::SmallString<0u>::operator llvm::StringRef() const
Line
Count
Source
277
12.8k
  operator StringRef() const { return str(); }
llvm::SmallString<10u>::operator llvm::StringRef() const
Line
Count
Source
277
400
  operator StringRef() const { return str(); }
llvm::SmallString<5u>::operator llvm::StringRef() const
Line
Count
Source
277
60
  operator StringRef() const { return str(); }
278
279
  // Extra operators.
280
2.18M
  const SmallString &operator=(StringRef RHS) {
281
2.18M
    this->clear();
282
2.18M
    return *this += RHS;
283
2.18M
  }
llvm::SmallString<128u>::operator=(llvm::StringRef)
Line
Count
Source
280
269k
  const SmallString &operator=(StringRef RHS) {
281
269k
    this->clear();
282
269k
    return *this += RHS;
283
269k
  }
llvm::SmallString<256u>::operator=(llvm::StringRef)
Line
Count
Source
280
19.1k
  const SmallString &operator=(StringRef RHS) {
281
19.1k
    this->clear();
282
19.1k
    return *this += RHS;
283
19.1k
  }
llvm::SmallString<32u>::operator=(llvm::StringRef)
Line
Count
Source
280
159k
  const SmallString &operator=(StringRef RHS) {
281
159k
    this->clear();
282
159k
    return *this += RHS;
283
159k
  }
llvm::SmallString<24u>::operator=(llvm::StringRef)
Line
Count
Source
280
66
  const SmallString &operator=(StringRef RHS) {
281
66
    this->clear();
282
66
    return *this += RHS;
283
66
  }
llvm::SmallString<64u>::operator=(llvm::StringRef)
Line
Count
Source
280
72
  const SmallString &operator=(StringRef RHS) {
281
72
    this->clear();
282
72
    return *this += RHS;
283
72
  }
llvm::SmallString<512u>::operator=(llvm::StringRef)
Line
Count
Source
280
112
  const SmallString &operator=(StringRef RHS) {
281
112
    this->clear();
282
112
    return *this += RHS;
283
112
  }
llvm::SmallString<40u>::operator=(llvm::StringRef)
Line
Count
Source
280
68
  const SmallString &operator=(StringRef RHS) {
281
68
    this->clear();
282
68
    return *this += RHS;
283
68
  }
llvm::SmallString<1024u>::operator=(llvm::StringRef)
Line
Count
Source
280
1.73M
  const SmallString &operator=(StringRef RHS) {
281
1.73M
    this->clear();
282
1.73M
    return *this += RHS;
283
1.73M
  }
llvm::SmallString<16u>::operator=(llvm::StringRef)
Line
Count
Source
280
1.22k
  const SmallString &operator=(StringRef RHS) {
281
1.22k
    this->clear();
282
1.22k
    return *this += RHS;
283
1.22k
  }
284
285
24.2M
  SmallString &operator+=(StringRef RHS) {
286
24.2M
    this->append(RHS.begin(), RHS.end());
287
24.2M
    return *this;
288
24.2M
  }
llvm::SmallString<128u>::operator+=(llvm::StringRef)
Line
Count
Source
285
1.37M
  SmallString &operator+=(StringRef RHS) {
286
1.37M
    this->append(RHS.begin(), RHS.end());
287
1.37M
    return *this;
288
1.37M
  }
llvm::SmallString<256u>::operator+=(llvm::StringRef)
Line
Count
Source
285
25.9k
  SmallString &operator+=(StringRef RHS) {
286
25.9k
    this->append(RHS.begin(), RHS.end());
287
25.9k
    return *this;
288
25.9k
  }
llvm::SmallString<512u>::operator+=(llvm::StringRef)
Line
Count
Source
285
8.62M
  SmallString &operator+=(StringRef RHS) {
286
8.62M
    this->append(RHS.begin(), RHS.end());
287
8.62M
    return *this;
288
8.62M
  }
llvm::SmallString<16u>::operator+=(llvm::StringRef)
Line
Count
Source
285
53.2k
  SmallString &operator+=(StringRef RHS) {
286
53.2k
    this->append(RHS.begin(), RHS.end());
287
53.2k
    return *this;
288
53.2k
  }
llvm::SmallString<64u>::operator+=(llvm::StringRef)
Line
Count
Source
285
11.9M
  SmallString &operator+=(StringRef RHS) {
286
11.9M
    this->append(RHS.begin(), RHS.end());
287
11.9M
    return *this;
288
11.9M
  }
llvm::SmallString<32u>::operator+=(llvm::StringRef)
Line
Count
Source
285
481k
  SmallString &operator+=(StringRef RHS) {
286
481k
    this->append(RHS.begin(), RHS.end());
287
481k
    return *this;
288
481k
  }
llvm::SmallString<8u>::operator+=(llvm::StringRef)
Line
Count
Source
285
12.4k
  SmallString &operator+=(StringRef RHS) {
286
12.4k
    this->append(RHS.begin(), RHS.end());
287
12.4k
    return *this;
288
12.4k
  }
llvm::SmallString<20u>::operator+=(llvm::StringRef)
Line
Count
Source
285
677
  SmallString &operator+=(StringRef RHS) {
286
677
    this->append(RHS.begin(), RHS.end());
287
677
    return *this;
288
677
  }
llvm::SmallString<23u>::operator+=(llvm::StringRef)
Line
Count
Source
285
12
  SmallString &operator+=(StringRef RHS) {
286
12
    this->append(RHS.begin(), RHS.end());
287
12
    return *this;
288
12
  }
llvm::SmallString<24u>::operator+=(llvm::StringRef)
Line
Count
Source
285
121
  SmallString &operator+=(StringRef RHS) {
286
121
    this->append(RHS.begin(), RHS.end());
287
121
    return *this;
288
121
  }
llvm::SmallString<1024u>::operator+=(llvm::StringRef)
Line
Count
Source
285
1.78M
  SmallString &operator+=(StringRef RHS) {
286
1.78M
    this->append(RHS.begin(), RHS.end());
287
1.78M
    return *this;
288
1.78M
  }
llvm::SmallString<40u>::operator+=(llvm::StringRef)
Line
Count
Source
285
71
  SmallString &operator+=(StringRef RHS) {
286
71
    this->append(RHS.begin(), RHS.end());
287
71
    return *this;
288
71
  }
llvm::SmallString<80u>::operator+=(llvm::StringRef)
Line
Count
Source
285
6
  SmallString &operator+=(StringRef RHS) {
286
6
    this->append(RHS.begin(), RHS.end());
287
6
    return *this;
288
6
  }
llvm::SmallString<42u>::operator+=(llvm::StringRef)
Line
Count
Source
285
239
  SmallString &operator+=(StringRef RHS) {
286
239
    this->append(RHS.begin(), RHS.end());
287
239
    return *this;
288
239
  }
llvm::SmallString<10u>::operator+=(llvm::StringRef)
Line
Count
Source
285
270
  SmallString &operator+=(StringRef RHS) {
286
270
    this->append(RHS.begin(), RHS.end());
287
270
    return *this;
288
270
  }
llvm::SmallString<60u>::operator+=(llvm::StringRef)
Line
Count
Source
285
14.0k
  SmallString &operator+=(StringRef RHS) {
286
14.0k
    this->append(RHS.begin(), RHS.end());
287
14.0k
    return *this;
288
14.0k
  }
289
115M
  SmallString &operator+=(char C) {
290
115M
    this->push_back(C);
291
115M
    return *this;
292
115M
  }
llvm::SmallString<16u>::operator+=(char)
Line
Count
Source
289
44.4k
  SmallString &operator+=(char C) {
290
44.4k
    this->push_back(C);
291
44.4k
    return *this;
292
44.4k
  }
llvm::SmallString<20u>::operator+=(char)
Line
Count
Source
289
166
  SmallString &operator+=(char C) {
290
166
    this->push_back(C);
291
166
    return *this;
292
166
  }
llvm::SmallString<256u>::operator+=(char)
Line
Count
Source
289
662
  SmallString &operator+=(char C) {
290
662
    this->push_back(C);
291
662
    return *this;
292
662
  }
llvm::SmallString<128u>::operator+=(char)
Line
Count
Source
289
110M
  SmallString &operator+=(char C) {
290
110M
    this->push_back(C);
291
110M
    return *this;
292
110M
  }
llvm::SmallString<64u>::operator+=(char)
Line
Count
Source
289
5.03M
  SmallString &operator+=(char C) {
290
5.03M
    this->push_back(C);
291
5.03M
    return *this;
292
5.03M
  }
llvm::SmallString<8u>::operator+=(char)
Line
Count
Source
289
114
  SmallString &operator+=(char C) {
290
114
    this->push_back(C);
291
114
    return *this;
292
114
  }
llvm::SmallString<32u>::operator+=(char)
Line
Count
Source
289
179
  SmallString &operator+=(char C) {
290
179
    this->push_back(C);
291
179
    return *this;
292
179
  }
Unexecuted instantiation: llvm::SmallString<0u>::operator+=(char)
llvm::SmallString<512u>::operator+=(char)
Line
Count
Source
289
1.08k
  SmallString &operator+=(char C) {
290
1.08k
    this->push_back(C);
291
1.08k
    return *this;
292
1.08k
  }
llvm::SmallString<40u>::operator+=(char)
Line
Count
Source
289
3
  SmallString &operator+=(char C) {
290
3
    this->push_back(C);
291
3
    return *this;
292
3
  }
293
};
294
295
} // end namespace llvm
296
297
#endif // LLVM_ADT_SMALLSTRING_H