Coverage Report

Created: 2018-12-11 00:00

/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
246M
  SmallString() = default;
llvm::SmallString<128u>::SmallString()
Line
Count
Source
29
58.7M
  SmallString() = default;
llvm::SmallString<64u>::SmallString()
Line
Count
Source
29
16.3M
  SmallString() = default;
llvm::SmallString<40u>::SmallString()
Line
Count
Source
29
2.82M
  SmallString() = default;
llvm::SmallString<60u>::SmallString()
Line
Count
Source
29
57.5k
  SmallString() = default;
llvm::SmallString<256u>::SmallString()
Line
Count
Source
29
78.0M
  SmallString() = default;
llvm::SmallString<32u>::SmallString()
Line
Count
Source
29
51.4M
  SmallString() = default;
llvm::SmallString<512u>::SmallString()
Line
Count
Source
29
10.4M
  SmallString() = default;
llvm::SmallString<16u>::SmallString()
Line
Count
Source
29
24.2M
  SmallString() = default;
llvm::SmallString<126u>::SmallString()
Line
Count
Source
29
22
  SmallString() = default;
llvm::SmallString<24u>::SmallString()
Line
Count
Source
29
106
  SmallString() = default;
llvm::SmallString<2048u>::SmallString()
Line
Count
Source
29
1.69k
  SmallString() = default;
llvm::SmallString<8u>::SmallString()
Line
Count
Source
29
241k
  SmallString() = default;
llvm::SmallString<0u>::SmallString()
Line
Count
Source
29
32.1k
  SmallString() = default;
llvm::SmallString<16384u>::SmallString()
Line
Count
Source
29
35.3k
  SmallString() = default;
llvm::SmallString<10u>::SmallString()
Line
Count
Source
29
36.5k
  SmallString() = default;
llvm::SmallString<4u>::SmallString()
Line
Count
Source
29
109
  SmallString() = default;
llvm::SmallString<5u>::SmallString()
Line
Count
Source
29
115
  SmallString() = default;
llvm::SmallString<20u>::SmallString()
Line
Count
Source
29
791
  SmallString() = default;
llvm::SmallString<4096u>::SmallString()
Line
Count
Source
29
19.9k
  SmallString() = default;
llvm::SmallString<36u>::SmallString()
Line
Count
Source
29
37
  SmallString() = default;
llvm::SmallString<12u>::SmallString()
Line
Count
Source
29
1.99k
  SmallString() = default;
llvm::SmallString<1024u>::SmallString()
Line
Count
Source
29
3.72M
  SmallString() = default;
llvm::SmallString<100u>::SmallString()
Line
Count
Source
29
232k
  SmallString() = default;
llvm::SmallString<200u>::SmallString()
Line
Count
Source
29
1.82k
  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
9
  SmallString() = default;
llvm::SmallString<320u>::SmallString()
Line
Count
Source
29
16
  SmallString() = default;
llvm::SmallString<50u>::SmallString()
Line
Count
Source
29
236
  SmallString() = default;
llvm::SmallString<136u>::SmallString()
Line
Count
Source
29
873
  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
24.4M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<128u>::SmallString(llvm::StringRef)
Line
Count
Source
32
5.12M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<256u>::SmallString(llvm::StringRef)
Line
Count
Source
32
919k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<64u>::SmallString(llvm::StringRef)
Line
Count
Source
32
251k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<32u>::SmallString(llvm::StringRef)
Line
Count
Source
32
25.1k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<16u>::SmallString(llvm::StringRef)
Line
Count
Source
32
262
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<20u>::SmallString(llvm::StringRef)
Line
Count
Source
32
94
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<8u>::SmallString(llvm::StringRef)
Line
Count
Source
32
4.67k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<1024u>::SmallString(llvm::StringRef)
Line
Count
Source
32
4.35k
  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
18.1M
  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
142
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<40u>::SmallString(llvm::StringRef)
Line
Count
Source
32
1.71k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
33
34
  /// Initialize with a range.
35
  template<typename ItTy>
36
4.68M
  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.21M
  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.04M
  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
494
  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
llvm::SmallString<1024u>::SmallString<char const*>(char const*, char const*)
Line
Count
Source
36
38
  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
176k
  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.3k
  void assign(StringRef RHS) {
59
57.3k
    this->clear();
60
57.3k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
61
57.3k
  }
llvm::SmallString<32u>::assign(llvm::StringRef)
Line
Count
Source
58
1.31k
  void assign(StringRef RHS) {
59
1.31k
    this->clear();
60
1.31k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
61
1.31k
  }
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
28.6M
  void append(in_iter S, in_iter E) {
76
28.6M
    SmallVectorImpl<char>::append(S, E);
77
28.6M
  }
void llvm::SmallString<128u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
1.31M
  void append(in_iter S, in_iter E) {
76
1.31M
    SmallVectorImpl<char>::append(S, E);
77
1.31M
  }
void llvm::SmallString<256u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
33.6k
  void append(in_iter S, in_iter E) {
76
33.6k
    SmallVectorImpl<char>::append(S, E);
77
33.6k
  }
void llvm::SmallString<512u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
12.5M
  void append(in_iter S, in_iter E) {
76
12.5M
    SmallVectorImpl<char>::append(S, E);
77
12.5M
  }
void llvm::SmallString<16u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
53.0k
  void append(in_iter S, in_iter E) {
76
53.0k
    SmallVectorImpl<char>::append(S, E);
77
53.0k
  }
void llvm::SmallString<64u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
12.1M
  void append(in_iter S, in_iter E) {
76
12.1M
    SmallVectorImpl<char>::append(S, E);
77
12.1M
  }
void llvm::SmallString<32u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
486k
  void append(in_iter S, in_iter E) {
76
486k
    SmallVectorImpl<char>::append(S, E);
77
486k
  }
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
56
  void append(in_iter S, in_iter E) {
76
56
    SmallVectorImpl<char>::append(S, E);
77
56
  }
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
145
  void append(in_iter S, in_iter E) {
76
145
    SmallVectorImpl<char>::append(S, E);
77
145
  }
void llvm::SmallString<1024u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
1.94M
  void append(in_iter S, in_iter E) {
76
1.94M
    SmallVectorImpl<char>::append(S, E);
77
1.94M
  }
void llvm::SmallString<40u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
120
  void append(in_iter S, in_iter E) {
76
120
    SmallVectorImpl<char>::append(S, E);
77
120
  }
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.51k
  void append(in_iter S, in_iter E) {
76
3.51k
    SmallVectorImpl<char>::append(S, E);
77
3.51k
  }
void llvm::SmallString<10u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
282
  void append(in_iter S, in_iter E) {
76
282
    SmallVectorImpl<char>::append(S, E);
77
282
  }
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.39k
  void append(in_iter S, in_iter E) {
76
3.39k
    SmallVectorImpl<char>::append(S, E);
77
3.39k
  }
void llvm::SmallString<60u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
28.8k
  void append(in_iter S, in_iter E) {
76
28.8k
    SmallVectorImpl<char>::append(S, E);
77
28.8k
  }
78
79
111k
  void append(size_t NumInputs, char Elt) {
80
111k
    SmallVectorImpl<char>::append(NumInputs, Elt);
81
111k
  }
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
111k
  void append(size_t NumInputs, char Elt) {
80
111k
    SmallVectorImpl<char>::append(NumInputs, Elt);
81
111k
  }
82
83
  /// Append from a StringRef.
84
832k
  void append(StringRef RHS) {
85
832k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
832k
  }
llvm::SmallString<128u>::append(llvm::StringRef)
Line
Count
Source
84
716k
  void append(StringRef RHS) {
85
716k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
716k
  }
llvm::SmallString<256u>::append(llvm::StringRef)
Line
Count
Source
84
115k
  void append(StringRef RHS) {
85
115k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
115k
  }
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
86
  void append(StringRef RHS) {
85
86
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
86
  }
llvm::SmallString<32u>::append(llvm::StringRef)
Line
Count
Source
84
371
  void append(StringRef RHS) {
85
371
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
371
  }
llvm::SmallString<16u>::append(llvm::StringRef)
Line
Count
Source
84
100
  void append(StringRef RHS) {
85
100
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
100
  }
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
610
  bool startswith(StringRef Prefix) const {
131
610
    return str().startswith(Prefix);
132
610
  }
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
189
  bool startswith(StringRef Prefix) const {
131
189
    return str().startswith(Prefix);
132
189
  }
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.01k
  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
247
4.01k
    return str().substr(Start, N);
248
4.01k
  }
llvm::SmallString<256u>::substr(unsigned long, unsigned long) const
Line
Count
Source
246
3.74k
  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
247
3.74k
    return str().substr(Start, N);
248
3.74k
  }
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.07M
  StringRef slice(size_t Start, size_t End) const {
261
4.07M
    return str().slice(Start, End);
262
4.07M
  }
263
264
  // Extra methods.
265
266
  /// Explicit conversion to StringRef.
267
68.6M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<128u>::str() const
Line
Count
Source
267
23.0M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<256u>::str() const
Line
Count
Source
267
1.91M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<512u>::str() const
Line
Count
Source
267
8.15M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<16u>::str() const
Line
Count
Source
267
3.33M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<24u>::str() const
Line
Count
Source
267
84
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<32u>::str() const
Line
Count
Source
267
4.98M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<64u>::str() const
Line
Count
Source
267
21.4M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<8u>::str() const
Line
Count
Source
267
182k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<0u>::str() const
Line
Count
Source
267
13.0k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<40u>::str() const
Line
Count
Source
267
1.57M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<16384u>::str() const
Line
Count
Source
267
35.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
267
652
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<4096u>::str() const
Line
Count
Source
267
19.8k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<1024u>::str() const
Line
Count
Source
267
3.68M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<36u>::str() const
Line
Count
Source
267
37
  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
201k
  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
143
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<136u>::str() const
Line
Count
Source
267
873
  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
435
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<5u>::str() const
Line
Count
Source
267
59
  StringRef str() const { return StringRef(this->begin(), this->size()); }
268
269
  // TODO: Make this const, if it's safe...
270
679k
  const char* c_str() {
271
679k
    this->push_back(0);
272
679k
    this->pop_back();
273
679k
    return this->data();
274
679k
  }
llvm::SmallString<8u>::c_str()
Line
Count
Source
270
31.7k
  const char* c_str() {
271
31.7k
    this->push_back(0);
272
31.7k
    this->pop_back();
273
31.7k
    return this->data();
274
31.7k
  }
llvm::SmallString<128u>::c_str()
Line
Count
Source
270
647k
  const char* c_str() {
271
647k
    this->push_back(0);
272
647k
    this->pop_back();
273
647k
    return this->data();
274
647k
  }
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
346
  const char* c_str() {
271
346
    this->push_back(0);
272
346
    this->pop_back();
273
346
    return this->data();
274
346
  }
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
59.9M
  operator StringRef() const { return str(); }
llvm::SmallString<128u>::operator llvm::StringRef() const
Line
Count
Source
277
22.1M
  operator StringRef() const { return str(); }
llvm::SmallString<256u>::operator llvm::StringRef() const
Line
Count
Source
277
1.35M
  operator StringRef() const { return str(); }
llvm::SmallString<32u>::operator llvm::StringRef() const
Line
Count
Source
277
4.98M
  operator StringRef() const { return str(); }
llvm::SmallString<512u>::operator llvm::StringRef() const
Line
Count
Source
277
4.08M
  operator StringRef() const { return str(); }
llvm::SmallString<16u>::operator llvm::StringRef() const
Line
Count
Source
277
2.31M
  operator StringRef() const { return str(); }
llvm::SmallString<24u>::operator llvm::StringRef() const
Line
Count
Source
277
84
  operator StringRef() const { return str(); }
llvm::SmallString<64u>::operator llvm::StringRef() const
Line
Count
Source
277
21.2M
  operator StringRef() const { return str(); }
llvm::SmallString<8u>::operator llvm::StringRef() const
Line
Count
Source
277
16.6k
  operator StringRef() const { return str(); }
llvm::SmallString<16384u>::operator llvm::StringRef() const
Line
Count
Source
277
35.3k
  operator StringRef() const { return str(); }
llvm::SmallString<20u>::operator llvm::StringRef() const
Line
Count
Source
277
608
  operator StringRef() const { return str(); }
llvm::SmallString<4096u>::operator llvm::StringRef() const
Line
Count
Source
277
19.8k
  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.67M
  operator StringRef() const { return str(); }
llvm::SmallString<40u>::operator llvm::StringRef() const
Line
Count
Source
277
6.86k
  operator StringRef() const { return str(); }
llvm::SmallString<100u>::operator llvm::StringRef() const
Line
Count
Source
277
1.22k
  operator StringRef() const { return str(); }
llvm::SmallString<50u>::operator llvm::StringRef() const
Line
Count
Source
277
143
  operator StringRef() const { return str(); }
llvm::SmallString<136u>::operator llvm::StringRef() const
Line
Count
Source
277
873
  operator StringRef() const { return str(); }
llvm::SmallString<0u>::operator llvm::StringRef() const
Line
Count
Source
277
12.9k
  operator StringRef() const { return str(); }
llvm::SmallString<10u>::operator llvm::StringRef() const
Line
Count
Source
277
406
  operator StringRef() const { return str(); }
llvm::SmallString<5u>::operator llvm::StringRef() const
Line
Count
Source
277
59
  operator StringRef() const { return str(); }
278
279
  // Extra operators.
280
2.19M
  const SmallString &operator=(StringRef RHS) {
281
2.19M
    this->clear();
282
2.19M
    return *this += RHS;
283
2.19M
  }
llvm::SmallString<128u>::operator=(llvm::StringRef)
Line
Count
Source
280
295k
  const SmallString &operator=(StringRef RHS) {
281
295k
    this->clear();
282
295k
    return *this += RHS;
283
295k
  }
llvm::SmallString<256u>::operator=(llvm::StringRef)
Line
Count
Source
280
20.6k
  const SmallString &operator=(StringRef RHS) {
281
20.6k
    this->clear();
282
20.6k
    return *this += RHS;
283
20.6k
  }
llvm::SmallString<32u>::operator=(llvm::StringRef)
Line
Count
Source
280
160k
  const SmallString &operator=(StringRef RHS) {
281
160k
    this->clear();
282
160k
    return *this += RHS;
283
160k
  }
llvm::SmallString<24u>::operator=(llvm::StringRef)
Line
Count
Source
280
78
  const SmallString &operator=(StringRef RHS) {
281
78
    this->clear();
282
78
    return *this += RHS;
283
78
  }
llvm::SmallString<64u>::operator=(llvm::StringRef)
Line
Count
Source
280
106
  const SmallString &operator=(StringRef RHS) {
281
106
    this->clear();
282
106
    return *this += RHS;
283
106
  }
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
114
  const SmallString &operator=(StringRef RHS) {
281
114
    this->clear();
282
114
    return *this += RHS;
283
114
  }
llvm::SmallString<1024u>::operator=(llvm::StringRef)
Line
Count
Source
280
1.72M
  const SmallString &operator=(StringRef RHS) {
281
1.72M
    this->clear();
282
1.72M
    return *this += RHS;
283
1.72M
  }
llvm::SmallString<16u>::operator=(llvm::StringRef)
Line
Count
Source
280
1.29k
  const SmallString &operator=(StringRef RHS) {
281
1.29k
    this->clear();
282
1.29k
    return *this += RHS;
283
1.29k
  }
284
285
28.4M
  SmallString &operator+=(StringRef RHS) {
286
28.4M
    this->append(RHS.begin(), RHS.end());
287
28.4M
    return *this;
288
28.4M
  }
llvm::SmallString<128u>::operator+=(llvm::StringRef)
Line
Count
Source
285
1.31M
  SmallString &operator+=(StringRef RHS) {
286
1.31M
    this->append(RHS.begin(), RHS.end());
287
1.31M
    return *this;
288
1.31M
  }
llvm::SmallString<256u>::operator+=(llvm::StringRef)
Line
Count
Source
285
27.9k
  SmallString &operator+=(StringRef RHS) {
286
27.9k
    this->append(RHS.begin(), RHS.end());
287
27.9k
    return *this;
288
27.9k
  }
llvm::SmallString<512u>::operator+=(llvm::StringRef)
Line
Count
Source
285
12.5M
  SmallString &operator+=(StringRef RHS) {
286
12.5M
    this->append(RHS.begin(), RHS.end());
287
12.5M
    return *this;
288
12.5M
  }
llvm::SmallString<16u>::operator+=(llvm::StringRef)
Line
Count
Source
285
53.0k
  SmallString &operator+=(StringRef RHS) {
286
53.0k
    this->append(RHS.begin(), RHS.end());
287
53.0k
    return *this;
288
53.0k
  }
llvm::SmallString<64u>::operator+=(llvm::StringRef)
Line
Count
Source
285
12.1M
  SmallString &operator+=(StringRef RHS) {
286
12.1M
    this->append(RHS.begin(), RHS.end());
287
12.1M
    return *this;
288
12.1M
  }
llvm::SmallString<32u>::operator+=(llvm::StringRef)
Line
Count
Source
285
486k
  SmallString &operator+=(StringRef RHS) {
286
486k
    this->append(RHS.begin(), RHS.end());
287
486k
    return *this;
288
486k
  }
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
56
  SmallString &operator+=(StringRef RHS) {
286
56
    this->append(RHS.begin(), RHS.end());
287
56
    return *this;
288
56
  }
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
145
  SmallString &operator+=(StringRef RHS) {
286
145
    this->append(RHS.begin(), RHS.end());
287
145
    return *this;
288
145
  }
llvm::SmallString<1024u>::operator+=(llvm::StringRef)
Line
Count
Source
285
1.76M
  SmallString &operator+=(StringRef RHS) {
286
1.76M
    this->append(RHS.begin(), RHS.end());
287
1.76M
    return *this;
288
1.76M
  }
llvm::SmallString<40u>::operator+=(llvm::StringRef)
Line
Count
Source
285
117
  SmallString &operator+=(StringRef RHS) {
286
117
    this->append(RHS.begin(), RHS.end());
287
117
    return *this;
288
117
  }
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
282
  SmallString &operator+=(StringRef RHS) {
286
282
    this->append(RHS.begin(), RHS.end());
287
282
    return *this;
288
282
  }
llvm::SmallString<60u>::operator+=(llvm::StringRef)
Line
Count
Source
285
14.4k
  SmallString &operator+=(StringRef RHS) {
286
14.4k
    this->append(RHS.begin(), RHS.end());
287
14.4k
    return *this;
288
14.4k
  }
289
116M
  SmallString &operator+=(char C) {
290
116M
    this->push_back(C);
291
116M
    return *this;
292
116M
  }
llvm::SmallString<16u>::operator+=(char)
Line
Count
Source
289
47.1k
  SmallString &operator+=(char C) {
290
47.1k
    this->push_back(C);
291
47.1k
    return *this;
292
47.1k
  }
llvm::SmallString<20u>::operator+=(char)
Line
Count
Source
289
124
  SmallString &operator+=(char C) {
290
124
    this->push_back(C);
291
124
    return *this;
292
124
  }
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.07M
  SmallString &operator+=(char C) {
290
5.07M
    this->push_back(C);
291
5.07M
    return *this;
292
5.07M
  }
llvm::SmallString<8u>::operator+=(char)
Line
Count
Source
289
128
  SmallString &operator+=(char C) {
290
128
    this->push_back(C);
291
128
    return *this;
292
128
  }
llvm::SmallString<32u>::operator+=(char)
Line
Count
Source
289
180
  SmallString &operator+=(char C) {
290
180
    this->push_back(C);
291
180
    return *this;
292
180
  }
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