Coverage Report

Created: 2019-03-22 08:08

/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
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file defines the SmallString class.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_ADT_SMALLSTRING_H
14
#define LLVM_ADT_SMALLSTRING_H
15
16
#include "llvm/ADT/SmallVector.h"
17
#include "llvm/ADT/StringRef.h"
18
#include <cstddef>
19
20
namespace llvm {
21
22
/// SmallString - A SmallString is just a SmallVector with methods and accessors
23
/// that make it work better as a string (e.g. operator+ etc).
24
template<unsigned InternalLen>
25
class SmallString : public SmallVector<char, InternalLen> {
26
public:
27
  /// Default ctor - Initialize to empty.
28
262M
  SmallString() = default;
llvm::SmallString<128u>::SmallString()
Line
Count
Source
28
62.2M
  SmallString() = default;
llvm::SmallString<64u>::SmallString()
Line
Count
Source
28
17.2M
  SmallString() = default;
llvm::SmallString<40u>::SmallString()
Line
Count
Source
28
3.00M
  SmallString() = default;
llvm::SmallString<60u>::SmallString()
Line
Count
Source
28
70.5k
  SmallString() = default;
llvm::SmallString<256u>::SmallString()
Line
Count
Source
28
85.3M
  SmallString() = default;
llvm::SmallString<32u>::SmallString()
Line
Count
Source
28
57.1M
  SmallString() = default;
llvm::SmallString<512u>::SmallString()
Line
Count
Source
28
10.5M
  SmallString() = default;
llvm::SmallString<16u>::SmallString()
Line
Count
Source
28
22.9M
  SmallString() = default;
llvm::SmallString<126u>::SmallString()
Line
Count
Source
28
25
  SmallString() = default;
llvm::SmallString<24u>::SmallString()
Line
Count
Source
28
107
  SmallString() = default;
llvm::SmallString<2048u>::SmallString()
Line
Count
Source
28
1.75k
  SmallString() = default;
llvm::SmallString<8u>::SmallString()
Line
Count
Source
28
256k
  SmallString() = default;
llvm::SmallString<0u>::SmallString()
Line
Count
Source
28
32.9k
  SmallString() = default;
llvm::SmallString<16384u>::SmallString()
Line
Count
Source
28
36.3k
  SmallString() = default;
llvm::SmallString<10u>::SmallString()
Line
Count
Source
28
37.7k
  SmallString() = default;
llvm::SmallString<4u>::SmallString()
Line
Count
Source
28
109
  SmallString() = default;
llvm::SmallString<5u>::SmallString()
Line
Count
Source
28
115
  SmallString() = default;
llvm::SmallString<20u>::SmallString()
Line
Count
Source
28
879
  SmallString() = default;
llvm::SmallString<4096u>::SmallString()
Line
Count
Source
28
19.9k
  SmallString() = default;
llvm::SmallString<36u>::SmallString()
Line
Count
Source
28
39
  SmallString() = default;
llvm::SmallString<12u>::SmallString()
Line
Count
Source
28
2.00k
  SmallString() = default;
llvm::SmallString<1024u>::SmallString()
Line
Count
Source
28
3.73M
  SmallString() = default;
llvm::SmallString<100u>::SmallString()
Line
Count
Source
28
237k
  SmallString() = default;
llvm::SmallString<200u>::SmallString()
Line
Count
Source
28
1.98k
  SmallString() = default;
llvm::SmallString<80u>::SmallString()
Line
Count
Source
28
186
  SmallString() = default;
llvm::SmallString<120u>::SmallString()
Line
Count
Source
28
46
  SmallString() = default;
llvm::SmallString<192u>::SmallString()
Line
Count
Source
28
87
  SmallString() = default;
llvm::SmallString<70u>::SmallString()
Line
Count
Source
28
9
  SmallString() = default;
llvm::SmallString<320u>::SmallString()
Line
Count
Source
28
16
  SmallString() = default;
llvm::SmallString<50u>::SmallString()
Line
Count
Source
28
241
  SmallString() = default;
llvm::SmallString<136u>::SmallString()
Line
Count
Source
28
1.11k
  SmallString() = default;
llvm::SmallString<2u>::SmallString()
Line
Count
Source
28
27
  SmallString() = default;
llvm::SmallString<42u>::SmallString()
Line
Count
Source
28
25
  SmallString() = default;
llvm::SmallString<1u>::SmallString()
Line
Count
Source
28
36
  SmallString() = default;
29
30
  /// Initialize from a StringRef.
31
24.8M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<128u>::SmallString(llvm::StringRef)
Line
Count
Source
31
5.27M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<256u>::SmallString(llvm::StringRef)
Line
Count
Source
31
1.13M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<64u>::SmallString(llvm::StringRef)
Line
Count
Source
31
255k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<32u>::SmallString(llvm::StringRef)
Line
Count
Source
31
25.5k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<16u>::SmallString(llvm::StringRef)
Line
Count
Source
31
630
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<8u>::SmallString(llvm::StringRef)
Line
Count
Source
31
5.23k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<20u>::SmallString(llvm::StringRef)
Line
Count
Source
31
213
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<1024u>::SmallString(llvm::StringRef)
Line
Count
Source
31
4.45k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<23u>::SmallString(llvm::StringRef)
Line
Count
Source
31
12
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<261u>::SmallString(llvm::StringRef)
Line
Count
Source
31
7
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<512u>::SmallString(llvm::StringRef)
Line
Count
Source
31
146
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<200u>::SmallString(llvm::StringRef)
Line
Count
Source
31
69
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<80u>::SmallString(llvm::StringRef)
Line
Count
Source
31
18.1M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<100u>::SmallString(llvm::StringRef)
Line
Count
Source
31
554
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<10u>::SmallString(llvm::StringRef)
Line
Count
Source
31
145
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
32
33
  /// Initialize with a range.
34
  template<typename ItTy>
35
4.76M
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<256u>::SmallString<char const*>(char const*, char const*)
Line
Count
Source
35
1.23M
  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
35
3.09M
  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
35
511
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<1024u>::SmallString<char const*>(char const*, char const*)
Line
Count
Source
35
38
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<32u>::SmallString<char const*>(char const*, char const*)
Line
Count
Source
35
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
35
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
35
186k
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
36
37
  // Note that in order to add new overloads for append & assign, we have to
38
  // duplicate the inherited versions so as not to inadvertently hide them.
39
40
  /// @}
41
  /// @name String Assignment
42
  /// @{
43
44
  /// Assign from a repeated element.
45
3.35k
  void assign(size_t NumElts, char Elt) {
46
3.35k
    this->SmallVectorImpl<char>::assign(NumElts, Elt);
47
3.35k
  }
48
49
  /// Assign from an iterator pair.
50
  template<typename in_iter>
51
  void assign(in_iter S, in_iter E) {
52
    this->clear();
53
    SmallVectorImpl<char>::append(S, E);
54
  }
55
56
  /// Assign from a StringRef.
57
62.7k
  void assign(StringRef RHS) {
58
62.7k
    this->clear();
59
62.7k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
60
62.7k
  }
llvm::SmallString<128u>::assign(llvm::StringRef)
Line
Count
Source
57
61.3k
  void assign(StringRef RHS) {
58
61.3k
    this->clear();
59
61.3k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
60
61.3k
  }
llvm::SmallString<32u>::assign(llvm::StringRef)
Line
Count
Source
57
1.31k
  void assign(StringRef RHS) {
58
1.31k
    this->clear();
59
1.31k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
60
1.31k
  }
llvm::SmallString<256u>::assign(llvm::StringRef)
Line
Count
Source
57
53
  void assign(StringRef RHS) {
58
53
    this->clear();
59
53
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
60
53
  }
61
62
  /// Assign from a SmallVector.
63
1
  void assign(const SmallVectorImpl<char> &RHS) {
64
1
    this->clear();
65
1
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
66
1
  }
67
68
  /// @}
69
  /// @name String Concatenation
70
  /// @{
71
72
  /// Append from an iterator pair.
73
  template<typename in_iter>
74
28.8M
  void append(in_iter S, in_iter E) {
75
28.8M
    SmallVectorImpl<char>::append(S, E);
76
28.8M
  }
void llvm::SmallString<128u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
1.32M
  void append(in_iter S, in_iter E) {
75
1.32M
    SmallVectorImpl<char>::append(S, E);
76
1.32M
  }
void llvm::SmallString<256u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
38.9k
  void append(in_iter S, in_iter E) {
75
38.9k
    SmallVectorImpl<char>::append(S, E);
76
38.9k
  }
void llvm::SmallString<512u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
11.9M
  void append(in_iter S, in_iter E) {
75
11.9M
    SmallVectorImpl<char>::append(S, E);
76
11.9M
  }
void llvm::SmallString<16u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
56.0k
  void append(in_iter S, in_iter E) {
75
56.0k
    SmallVectorImpl<char>::append(S, E);
76
56.0k
  }
void llvm::SmallString<64u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
12.9M
  void append(in_iter S, in_iter E) {
75
12.9M
    SmallVectorImpl<char>::append(S, E);
76
12.9M
  }
void llvm::SmallString<32u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
409k
  void append(in_iter S, in_iter E) {
75
409k
    SmallVectorImpl<char>::append(S, E);
76
409k
  }
void llvm::SmallString<8u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
12.7k
  void append(in_iter S, in_iter E) {
75
12.7k
    SmallVectorImpl<char>::append(S, E);
76
12.7k
  }
Unexecuted instantiation: void llvm::SmallString<128u>::append<char*>(char*, char*)
void llvm::SmallString<20u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
98
  void append(in_iter S, in_iter E) {
75
98
    SmallVectorImpl<char>::append(S, E);
76
98
  }
void llvm::SmallString<23u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
12
  void append(in_iter S, in_iter E) {
75
12
    SmallVectorImpl<char>::append(S, E);
76
12
  }
void llvm::SmallString<24u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
145
  void append(in_iter S, in_iter E) {
75
145
    SmallVectorImpl<char>::append(S, E);
76
145
  }
void llvm::SmallString<1024u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
1.95M
  void append(in_iter S, in_iter E) {
75
1.95M
    SmallVectorImpl<char>::append(S, E);
76
1.95M
  }
void llvm::SmallString<4096u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
3.53k
  void append(in_iter S, in_iter E) {
75
3.53k
    SmallVectorImpl<char>::append(S, E);
76
3.53k
  }
void llvm::SmallString<40u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
119
  void append(in_iter S, in_iter E) {
75
119
    SmallVectorImpl<char>::append(S, E);
76
119
  }
void llvm::SmallString<80u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
6
  void append(in_iter S, in_iter E) {
75
6
    SmallVectorImpl<char>::append(S, E);
76
6
  }
void llvm::SmallString<42u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
239
  void append(in_iter S, in_iter E) {
75
239
    SmallVectorImpl<char>::append(S, E);
76
239
  }
void llvm::SmallString<10u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
288
  void append(in_iter S, in_iter E) {
75
288
    SmallVectorImpl<char>::append(S, E);
76
288
  }
void llvm::SmallString<128u>::append<std::__1::__wrap_iter<char*> >(std::__1::__wrap_iter<char*>, std::__1::__wrap_iter<char*>)
Line
Count
Source
74
3.46k
  void append(in_iter S, in_iter E) {
75
3.46k
    SmallVectorImpl<char>::append(S, E);
76
3.46k
  }
void llvm::SmallString<60u>::append<char const*>(char const*, char const*)
Line
Count
Source
74
28.3k
  void append(in_iter S, in_iter E) {
75
28.3k
    SmallVectorImpl<char>::append(S, E);
76
28.3k
  }
77
78
177k
  void append(size_t NumInputs, char Elt) {
79
177k
    SmallVectorImpl<char>::append(NumInputs, Elt);
80
177k
  }
llvm::SmallString<128u>::append(unsigned long, char)
Line
Count
Source
78
29
  void append(size_t NumInputs, char Elt) {
79
29
    SmallVectorImpl<char>::append(NumInputs, Elt);
80
29
  }
llvm::SmallString<256u>::append(unsigned long, char)
Line
Count
Source
78
177k
  void append(size_t NumInputs, char Elt) {
79
177k
    SmallVectorImpl<char>::append(NumInputs, Elt);
80
177k
  }
81
82
  /// Append from a StringRef.
83
934k
  void append(StringRef RHS) {
84
934k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
85
934k
  }
llvm::SmallString<128u>::append(llvm::StringRef)
Line
Count
Source
83
752k
  void append(StringRef RHS) {
84
752k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
85
752k
  }
llvm::SmallString<256u>::append(llvm::StringRef)
Line
Count
Source
83
180k
  void append(StringRef RHS) {
84
180k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
85
180k
  }
llvm::SmallString<64u>::append(llvm::StringRef)
Line
Count
Source
83
38
  void append(StringRef RHS) {
84
38
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
85
38
  }
llvm::SmallString<8u>::append(llvm::StringRef)
Line
Count
Source
83
102
  void append(StringRef RHS) {
84
102
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
85
102
  }
llvm::SmallString<32u>::append(llvm::StringRef)
Line
Count
Source
83
382
  void append(StringRef RHS) {
84
382
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
85
382
  }
llvm::SmallString<16u>::append(llvm::StringRef)
Line
Count
Source
83
100
  void append(StringRef RHS) {
84
100
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
85
100
  }
86
87
  /// Append from a SmallVector.
88
61
  void append(const SmallVectorImpl<char> &RHS) {
89
61
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
90
61
  }
91
92
  /// @}
93
  /// @name String Comparison
94
  /// @{
95
96
  /// Check for string equality.  This is more efficient than compare() when
97
  /// the relative ordering of inequal strings isn't needed.
98
0
  bool equals(StringRef RHS) const {
99
0
    return str().equals(RHS);
100
0
  }
101
102
  /// Check for string equality, ignoring case.
103
  bool equals_lower(StringRef RHS) const {
104
    return str().equals_lower(RHS);
105
  }
106
107
  /// Compare two strings; the result is -1, 0, or 1 if this string is
108
  /// lexicographically less than, equal to, or greater than the \p RHS.
109
  int compare(StringRef RHS) const {
110
    return str().compare(RHS);
111
  }
112
113
  /// compare_lower - Compare two strings, ignoring case.
114
  int compare_lower(StringRef RHS) const {
115
    return str().compare_lower(RHS);
116
  }
117
118
  /// compare_numeric - Compare two strings, treating sequences of digits as
119
  /// numbers.
120
  int compare_numeric(StringRef RHS) const {
121
    return str().compare_numeric(RHS);
122
  }
123
124
  /// @}
125
  /// @name String Predicates
126
  /// @{
127
128
  /// startswith - Check if this string starts with the given \p Prefix.
129
636
  bool startswith(StringRef Prefix) const {
130
636
    return str().startswith(Prefix);
131
636
  }
llvm::SmallString<128u>::startswith(llvm::StringRef) const
Line
Count
Source
129
439
  bool startswith(StringRef Prefix) const {
130
439
    return str().startswith(Prefix);
131
439
  }
llvm::SmallString<64u>::startswith(llvm::StringRef) const
Line
Count
Source
129
197
  bool startswith(StringRef Prefix) const {
130
197
    return str().startswith(Prefix);
131
197
  }
132
133
  /// endswith - Check if this string ends with the given \p Suffix.
134
7.92k
  bool endswith(StringRef Suffix) const {
135
7.92k
    return str().endswith(Suffix);
136
7.92k
  }
137
138
  /// @}
139
  /// @name String Searching
140
  /// @{
141
142
  /// find - Search for the first character \p C in the string.
143
  ///
144
  /// \return - The index of the first occurrence of \p C, or npos if not
145
  /// found.
146
  size_t find(char C, size_t From = 0) const {
147
    return str().find(C, From);
148
  }
149
150
  /// Search for the first string \p Str in the string.
151
  ///
152
  /// \returns The index of the first occurrence of \p Str, or npos if not
153
  /// found.
154
  size_t find(StringRef Str, size_t From = 0) const {
155
    return str().find(Str, From);
156
  }
157
158
  /// Search for the last character \p C in the string.
159
  ///
160
  /// \returns The index of the last occurrence of \p C, or npos if not
161
  /// found.
162
  size_t rfind(char C, size_t From = StringRef::npos) const {
163
    return str().rfind(C, From);
164
  }
165
166
  /// Search for the last string \p Str in the string.
167
  ///
168
  /// \returns The index of the last occurrence of \p Str, or npos if not
169
  /// found.
170
  size_t rfind(StringRef Str) const {
171
    return str().rfind(Str);
172
  }
173
174
  /// Find the first character in the string that is \p C, or npos if not
175
  /// found. Same as find.
176
  size_t find_first_of(char C, size_t From = 0) const {
177
    return str().find_first_of(C, From);
178
  }
179
180
  /// Find the first character in the string that is in \p Chars, or npos if
181
  /// not found.
182
  ///
183
  /// Complexity: O(size() + Chars.size())
184
6
  size_t find_first_of(StringRef Chars, size_t From = 0) const {
185
6
    return str().find_first_of(Chars, From);
186
6
  }
187
188
  /// Find the first character in the string that is not \p C or npos if not
189
  /// found.
190
  size_t find_first_not_of(char C, size_t From = 0) const {
191
    return str().find_first_not_of(C, From);
192
  }
193
194
  /// Find the first character in the string that is not in the string
195
  /// \p Chars, or npos if not found.
196
  ///
197
  /// Complexity: O(size() + Chars.size())
198
142
  size_t find_first_not_of(StringRef Chars, size_t From = 0) const {
199
142
    return str().find_first_not_of(Chars, From);
200
142
  }
201
202
  /// Find the last character in the string that is \p C, or npos if not
203
  /// found.
204
  size_t find_last_of(char C, size_t From = StringRef::npos) const {
205
    return str().find_last_of(C, From);
206
  }
207
208
  /// Find the last character in the string that is in \p C, or npos if not
209
  /// found.
210
  ///
211
  /// Complexity: O(size() + Chars.size())
212
  size_t find_last_of(
213
      StringRef Chars, size_t From = StringRef::npos) const {
214
    return str().find_last_of(Chars, From);
215
  }
216
217
  /// @}
218
  /// @name Helpful Algorithms
219
  /// @{
220
221
  /// Return the number of occurrences of \p C in the string.
222
  size_t count(char C) const {
223
    return str().count(C);
224
  }
225
226
  /// Return the number of non-overlapped occurrences of \p Str in the
227
  /// string.
228
  size_t count(StringRef Str) const {
229
    return str().count(Str);
230
  }
231
232
  /// @}
233
  /// @name Substring Operations
234
  /// @{
235
236
  /// Return a reference to the substring from [Start, Start + N).
237
  ///
238
  /// \param Start The index of the starting character in the substring; if
239
  /// the index is npos or greater than the length of the string then the
240
  /// empty substring will be returned.
241
  ///
242
  /// \param N The number of characters to included in the substring. If \p N
243
  /// exceeds the number of characters remaining in the string, the string
244
  /// suffix (starting with \p Start) will be returned.
245
4.07k
  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
246
4.07k
    return str().substr(Start, N);
247
4.07k
  }
llvm::SmallString<256u>::substr(unsigned long, unsigned long) const
Line
Count
Source
245
3.80k
  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
246
3.80k
    return str().substr(Start, N);
247
3.80k
  }
llvm::SmallString<128u>::substr(unsigned long, unsigned long) const
Line
Count
Source
245
268
  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
246
268
    return str().substr(Start, N);
247
268
  }
248
249
  /// Return a reference to the substring from [Start, End).
250
  ///
251
  /// \param Start The index of the starting character in the substring; if
252
  /// the index is npos or greater than the length of the string then the
253
  /// empty substring will be returned.
254
  ///
255
  /// \param End The index following the last character to include in the
256
  /// substring. If this is npos, or less than \p Start, or exceeds the
257
  /// number of characters remaining in the string, the string suffix
258
  /// (starting with \p Start) will be returned.
259
3.87M
  StringRef slice(size_t Start, size_t End) const {
260
3.87M
    return str().slice(Start, End);
261
3.87M
  }
262
263
  // Extra methods.
264
265
  /// Explicit conversion to StringRef.
266
70.3M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<128u>::str() const
Line
Count
Source
266
23.5M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<256u>::str() const
Line
Count
Source
266
1.94M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<512u>::str() const
Line
Count
Source
266
7.75M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<16u>::str() const
Line
Count
Source
266
3.38M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<24u>::str() const
Line
Count
Source
266
84
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<32u>::str() const
Line
Count
Source
266
4.76M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<64u>::str() const
Line
Count
Source
266
23.0M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<8u>::str() const
Line
Count
Source
266
192k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<0u>::str() const
Line
Count
Source
266
13.3k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<40u>::str() const
Line
Count
Source
266
1.66M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<16384u>::str() const
Line
Count
Source
266
36.3k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
Unexecuted instantiation: llvm::SmallString<2048u>::str() const
llvm::SmallString<20u>::str() const
Line
Count
Source
266
863
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<4096u>::str() const
Line
Count
Source
266
19.8k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<1024u>::str() const
Line
Count
Source
266
3.69M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<36u>::str() const
Line
Count
Source
266
39
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<23u>::str() const
Line
Count
Source
266
12
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<100u>::str() const
Line
Count
Source
266
205k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<200u>::str() const
Line
Count
Source
266
28
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<50u>::str() const
Line
Count
Source
266
147
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<136u>::str() const
Line
Count
Source
266
1.11k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<2u>::str() const
Line
Count
Source
266
27
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<10u>::str() const
Line
Count
Source
266
438
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<5u>::str() const
Line
Count
Source
266
59
  StringRef str() const { return StringRef(this->begin(), this->size()); }
267
268
  // TODO: Make this const, if it's safe...
269
700k
  const char* c_str() {
270
700k
    this->push_back(0);
271
700k
    this->pop_back();
272
700k
    return this->data();
273
700k
  }
llvm::SmallString<8u>::c_str()
Line
Count
Source
269
32.3k
  const char* c_str() {
270
32.3k
    this->push_back(0);
271
32.3k
    this->pop_back();
272
32.3k
    return this->data();
273
32.3k
  }
llvm::SmallString<128u>::c_str()
Line
Count
Source
269
666k
  const char* c_str() {
270
666k
    this->push_back(0);
271
666k
    this->pop_back();
272
666k
    return this->data();
273
666k
  }
llvm::SmallString<24u>::c_str()
Line
Count
Source
269
30
  const char* c_str() {
270
30
    this->push_back(0);
271
30
    this->pop_back();
272
30
    return this->data();
273
30
  }
Unexecuted instantiation: llvm::SmallString<2048u>::c_str()
llvm::SmallString<32u>::c_str()
Line
Count
Source
269
564
  const char* c_str() {
270
564
    this->push_back(0);
271
564
    this->pop_back();
272
564
    return this->data();
273
564
  }
llvm::SmallString<256u>::c_str()
Line
Count
Source
269
349
  const char* c_str() {
270
349
    this->push_back(0);
271
349
    this->pop_back();
272
349
    return this->data();
273
349
  }
Unexecuted instantiation: llvm::SmallString<16u>::c_str()
llvm::SmallString<80u>::c_str()
Line
Count
Source
269
3
  const char* c_str() {
270
3
    this->push_back(0);
271
3
    this->pop_back();
272
3
    return this->data();
273
3
  }
llvm::SmallString<1024u>::c_str()
Line
Count
Source
269
1
  const char* c_str() {
270
1
    this->push_back(0);
271
1
    this->pop_back();
272
1
    return this->data();
273
1
  }
274
275
  /// Implicit conversion to StringRef.
276
61.5M
  operator StringRef() const { return str(); }
llvm::SmallString<128u>::operator llvm::StringRef() const
Line
Count
Source
276
22.4M
  operator StringRef() const { return str(); }
llvm::SmallString<256u>::operator llvm::StringRef() const
Line
Count
Source
276
1.38M
  operator StringRef() const { return str(); }
llvm::SmallString<32u>::operator llvm::StringRef() const
Line
Count
Source
276
4.76M
  operator StringRef() const { return str(); }
llvm::SmallString<512u>::operator llvm::StringRef() const
Line
Count
Source
276
3.88M
  operator StringRef() const { return str(); }
llvm::SmallString<16u>::operator llvm::StringRef() const
Line
Count
Source
276
2.35M
  operator StringRef() const { return str(); }
llvm::SmallString<24u>::operator llvm::StringRef() const
Line
Count
Source
276
84
  operator StringRef() const { return str(); }
llvm::SmallString<64u>::operator llvm::StringRef() const
Line
Count
Source
276
22.8M
  operator StringRef() const { return str(); }
llvm::SmallString<8u>::operator llvm::StringRef() const
Line
Count
Source
276
17.0k
  operator StringRef() const { return str(); }
llvm::SmallString<16384u>::operator llvm::StringRef() const
Line
Count
Source
276
36.3k
  operator StringRef() const { return str(); }
llvm::SmallString<20u>::operator llvm::StringRef() const
Line
Count
Source
276
819
  operator StringRef() const { return str(); }
llvm::SmallString<4096u>::operator llvm::StringRef() const
Line
Count
Source
276
19.8k
  operator StringRef() const { return str(); }
llvm::SmallString<23u>::operator llvm::StringRef() const
Line
Count
Source
276
12
  operator StringRef() const { return str(); }
llvm::SmallString<1024u>::operator llvm::StringRef() const
Line
Count
Source
276
3.68M
  operator StringRef() const { return str(); }
llvm::SmallString<0u>::operator llvm::StringRef() const
Line
Count
Source
276
13.1k
  operator StringRef() const { return str(); }
llvm::SmallString<40u>::operator llvm::StringRef() const
Line
Count
Source
276
7.49k
  operator StringRef() const { return str(); }
llvm::SmallString<100u>::operator llvm::StringRef() const
Line
Count
Source
276
1.23k
  operator StringRef() const { return str(); }
llvm::SmallString<50u>::operator llvm::StringRef() const
Line
Count
Source
276
147
  operator StringRef() const { return str(); }
llvm::SmallString<136u>::operator llvm::StringRef() const
Line
Count
Source
276
1.11k
  operator StringRef() const { return str(); }
llvm::SmallString<10u>::operator llvm::StringRef() const
Line
Count
Source
276
409
  operator StringRef() const { return str(); }
llvm::SmallString<5u>::operator llvm::StringRef() const
Line
Count
Source
276
59
  operator StringRef() const { return str(); }
277
278
  // Extra operators.
279
2.20M
  const SmallString &operator=(StringRef RHS) {
280
2.20M
    this->clear();
281
2.20M
    return *this += RHS;
282
2.20M
  }
llvm::SmallString<128u>::operator=(llvm::StringRef)
Line
Count
Source
279
319k
  const SmallString &operator=(StringRef RHS) {
280
319k
    this->clear();
281
319k
    return *this += RHS;
282
319k
  }
llvm::SmallString<256u>::operator=(llvm::StringRef)
Line
Count
Source
279
21.0k
  const SmallString &operator=(StringRef RHS) {
280
21.0k
    this->clear();
281
21.0k
    return *this += RHS;
282
21.0k
  }
llvm::SmallString<32u>::operator=(llvm::StringRef)
Line
Count
Source
279
134k
  const SmallString &operator=(StringRef RHS) {
280
134k
    this->clear();
281
134k
    return *this += RHS;
282
134k
  }
llvm::SmallString<24u>::operator=(llvm::StringRef)
Line
Count
Source
279
78
  const SmallString &operator=(StringRef RHS) {
280
78
    this->clear();
281
78
    return *this += RHS;
282
78
  }
llvm::SmallString<64u>::operator=(llvm::StringRef)
Line
Count
Source
279
180
  const SmallString &operator=(StringRef RHS) {
280
180
    this->clear();
281
180
    return *this += RHS;
282
180
  }
llvm::SmallString<512u>::operator=(llvm::StringRef)
Line
Count
Source
279
115
  const SmallString &operator=(StringRef RHS) {
280
115
    this->clear();
281
115
    return *this += RHS;
282
115
  }
llvm::SmallString<40u>::operator=(llvm::StringRef)
Line
Count
Source
279
114
  const SmallString &operator=(StringRef RHS) {
280
114
    this->clear();
281
114
    return *this += RHS;
282
114
  }
llvm::SmallString<1024u>::operator=(llvm::StringRef)
Line
Count
Source
279
1.72M
  const SmallString &operator=(StringRef RHS) {
280
1.72M
    this->clear();
281
1.72M
    return *this += RHS;
282
1.72M
  }
llvm::SmallString<16u>::operator=(llvm::StringRef)
Line
Count
Source
279
1.36k
  const SmallString &operator=(StringRef RHS) {
280
1.36k
    this->clear();
281
1.36k
    return *this += RHS;
282
1.36k
  }
283
284
28.5M
  SmallString &operator+=(StringRef RHS) {
285
28.5M
    this->append(RHS.begin(), RHS.end());
286
28.5M
    return *this;
287
28.5M
  }
llvm::SmallString<128u>::operator+=(llvm::StringRef)
Line
Count
Source
284
1.32M
  SmallString &operator+=(StringRef RHS) {
285
1.32M
    this->append(RHS.begin(), RHS.end());
286
1.32M
    return *this;
287
1.32M
  }
llvm::SmallString<256u>::operator+=(llvm::StringRef)
Line
Count
Source
284
33.3k
  SmallString &operator+=(StringRef RHS) {
285
33.3k
    this->append(RHS.begin(), RHS.end());
286
33.3k
    return *this;
287
33.3k
  }
llvm::SmallString<512u>::operator+=(llvm::StringRef)
Line
Count
Source
284
11.9M
  SmallString &operator+=(StringRef RHS) {
285
11.9M
    this->append(RHS.begin(), RHS.end());
286
11.9M
    return *this;
287
11.9M
  }
llvm::SmallString<16u>::operator+=(llvm::StringRef)
Line
Count
Source
284
56.0k
  SmallString &operator+=(StringRef RHS) {
285
56.0k
    this->append(RHS.begin(), RHS.end());
286
56.0k
    return *this;
287
56.0k
  }
llvm::SmallString<64u>::operator+=(llvm::StringRef)
Line
Count
Source
284
12.9M
  SmallString &operator+=(StringRef RHS) {
285
12.9M
    this->append(RHS.begin(), RHS.end());
286
12.9M
    return *this;
287
12.9M
  }
llvm::SmallString<32u>::operator+=(llvm::StringRef)
Line
Count
Source
284
409k
  SmallString &operator+=(StringRef RHS) {
285
409k
    this->append(RHS.begin(), RHS.end());
286
409k
    return *this;
287
409k
  }
llvm::SmallString<8u>::operator+=(llvm::StringRef)
Line
Count
Source
284
12.7k
  SmallString &operator+=(StringRef RHS) {
285
12.7k
    this->append(RHS.begin(), RHS.end());
286
12.7k
    return *this;
287
12.7k
  }
llvm::SmallString<20u>::operator+=(llvm::StringRef)
Line
Count
Source
284
98
  SmallString &operator+=(StringRef RHS) {
285
98
    this->append(RHS.begin(), RHS.end());
286
98
    return *this;
287
98
  }
llvm::SmallString<23u>::operator+=(llvm::StringRef)
Line
Count
Source
284
12
  SmallString &operator+=(StringRef RHS) {
285
12
    this->append(RHS.begin(), RHS.end());
286
12
    return *this;
287
12
  }
llvm::SmallString<24u>::operator+=(llvm::StringRef)
Line
Count
Source
284
145
  SmallString &operator+=(StringRef RHS) {
285
145
    this->append(RHS.begin(), RHS.end());
286
145
    return *this;
287
145
  }
llvm::SmallString<1024u>::operator+=(llvm::StringRef)
Line
Count
Source
284
1.76M
  SmallString &operator+=(StringRef RHS) {
285
1.76M
    this->append(RHS.begin(), RHS.end());
286
1.76M
    return *this;
287
1.76M
  }
llvm::SmallString<40u>::operator+=(llvm::StringRef)
Line
Count
Source
284
117
  SmallString &operator+=(StringRef RHS) {
285
117
    this->append(RHS.begin(), RHS.end());
286
117
    return *this;
287
117
  }
llvm::SmallString<80u>::operator+=(llvm::StringRef)
Line
Count
Source
284
6
  SmallString &operator+=(StringRef RHS) {
285
6
    this->append(RHS.begin(), RHS.end());
286
6
    return *this;
287
6
  }
llvm::SmallString<42u>::operator+=(llvm::StringRef)
Line
Count
Source
284
239
  SmallString &operator+=(StringRef RHS) {
285
239
    this->append(RHS.begin(), RHS.end());
286
239
    return *this;
287
239
  }
llvm::SmallString<10u>::operator+=(llvm::StringRef)
Line
Count
Source
284
288
  SmallString &operator+=(StringRef RHS) {
285
288
    this->append(RHS.begin(), RHS.end());
286
288
    return *this;
287
288
  }
llvm::SmallString<60u>::operator+=(llvm::StringRef)
Line
Count
Source
284
14.1k
  SmallString &operator+=(StringRef RHS) {
285
14.1k
    this->append(RHS.begin(), RHS.end());
286
14.1k
    return *this;
287
14.1k
  }
288
116M
  SmallString &operator+=(char C) {
289
116M
    this->push_back(C);
290
116M
    return *this;
291
116M
  }
llvm::SmallString<16u>::operator+=(char)
Line
Count
Source
288
48.0k
  SmallString &operator+=(char C) {
289
48.0k
    this->push_back(C);
290
48.0k
    return *this;
291
48.0k
  }
llvm::SmallString<20u>::operator+=(char)
Line
Count
Source
288
289
  SmallString &operator+=(char C) {
289
289
    this->push_back(C);
290
289
    return *this;
291
289
  }
llvm::SmallString<256u>::operator+=(char)
Line
Count
Source
288
662
  SmallString &operator+=(char C) {
289
662
    this->push_back(C);
290
662
    return *this;
291
662
  }
llvm::SmallString<128u>::operator+=(char)
Line
Count
Source
288
110M
  SmallString &operator+=(char C) {
289
110M
    this->push_back(C);
290
110M
    return *this;
291
110M
  }
llvm::SmallString<64u>::operator+=(char)
Line
Count
Source
288
5.07M
  SmallString &operator+=(char C) {
289
5.07M
    this->push_back(C);
290
5.07M
    return *this;
291
5.07M
  }
llvm::SmallString<8u>::operator+=(char)
Line
Count
Source
288
130
  SmallString &operator+=(char C) {
289
130
    this->push_back(C);
290
130
    return *this;
291
130
  }
llvm::SmallString<32u>::operator+=(char)
Line
Count
Source
288
179
  SmallString &operator+=(char C) {
289
179
    this->push_back(C);
290
179
    return *this;
291
179
  }
Unexecuted instantiation: llvm::SmallString<0u>::operator+=(char)
llvm::SmallString<512u>::operator+=(char)
Line
Count
Source
288
1.08k
  SmallString &operator+=(char C) {
289
1.08k
    this->push_back(C);
290
1.08k
    return *this;
291
1.08k
  }
llvm::SmallString<40u>::operator+=(char)
Line
Count
Source
288
3
  SmallString &operator+=(char C) {
289
3
    this->push_back(C);
290
3
    return *this;
291
3
  }
292
};
293
294
} // end namespace llvm
295
296
#endif // LLVM_ADT_SMALLSTRING_H