Coverage Report

Created: 2018-07-12 09:57

/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
190M
  SmallString() = default;
llvm::SmallString<128u>::SmallString()
Line
Count
Source
29
49.4M
  SmallString() = default;
llvm::SmallString<64u>::SmallString()
Line
Count
Source
29
15.2M
  SmallString() = default;
llvm::SmallString<40u>::SmallString()
Line
Count
Source
29
2.61M
  SmallString() = default;
llvm::SmallString<60u>::SmallString()
Line
Count
Source
29
58.7k
  SmallString() = default;
llvm::SmallString<256u>::SmallString()
Line
Count
Source
29
72.2M
  SmallString() = default;
llvm::SmallString<32u>::SmallString()
Line
Count
Source
29
25.6M
  SmallString() = default;
llvm::SmallString<512u>::SmallString()
Line
Count
Source
29
10.2M
  SmallString() = default;
llvm::SmallString<16u>::SmallString()
Line
Count
Source
29
8.81M
  SmallString() = default;
llvm::SmallString<126u>::SmallString()
Line
Count
Source
29
22
  SmallString() = default;
llvm::SmallString<2048u>::SmallString()
Line
Count
Source
29
1.63k
  SmallString() = default;
llvm::SmallString<8u>::SmallString()
Line
Count
Source
29
1.29M
  SmallString() = default;
llvm::SmallString<0u>::SmallString()
Line
Count
Source
29
31.1k
  SmallString() = default;
llvm::SmallString<16384u>::SmallString()
Line
Count
Source
29
31.9k
  SmallString() = default;
llvm::SmallString<4u>::SmallString()
Line
Count
Source
29
97
  SmallString() = default;
llvm::SmallString<20u>::SmallString()
Line
Count
Source
29
763
  SmallString() = default;
llvm::SmallString<4096u>::SmallString()
Line
Count
Source
29
19.3k
  SmallString() = default;
llvm::SmallString<10u>::SmallString()
Line
Count
Source
29
45.8k
  SmallString() = default;
llvm::SmallString<5u>::SmallString()
Line
Count
Source
29
108
  SmallString() = default;
llvm::SmallString<36u>::SmallString()
Line
Count
Source
29
26
  SmallString() = default;
llvm::SmallString<24u>::SmallString()
Line
Count
Source
29
88
  SmallString() = default;
llvm::SmallString<1024u>::SmallString()
Line
Count
Source
29
3.98M
  SmallString() = default;
llvm::SmallString<100u>::SmallString()
Line
Count
Source
29
226k
  SmallString() = default;
llvm::SmallString<200u>::SmallString()
Line
Count
Source
29
1.72k
  SmallString() = default;
llvm::SmallString<80u>::SmallString()
Line
Count
Source
29
171
  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<136u>::SmallString()
Line
Count
Source
29
833
  SmallString() = default;
llvm::SmallString<50u>::SmallString()
Line
Count
Source
29
76
  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
21.2M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<128u>::SmallString(llvm::StringRef)
Line
Count
Source
32
4.22M
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<256u>::SmallString(llvm::StringRef)
Line
Count
Source
32
362k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<64u>::SmallString(llvm::StringRef)
Line
Count
Source
32
240k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<32u>::SmallString(llvm::StringRef)
Line
Count
Source
32
24.2k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<16u>::SmallString(llvm::StringRef)
Line
Count
Source
32
249
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<8u>::SmallString(llvm::StringRef)
Line
Count
Source
32
3.65k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<20u>::SmallString(llvm::StringRef)
Line
Count
Source
32
77
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<1024u>::SmallString(llvm::StringRef)
Line
Count
Source
32
4.22k
  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
llvm::SmallString<23u>::SmallString(llvm::StringRef)
Line
Count
Source
32
11
  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
144
  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.4M
  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()) {}
33
34
  /// Initialize with a range.
35
  template<typename ItTy>
36
4.64M
  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.15M
  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.07M
  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
437
  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
247k
  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
169k
  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
1.24k
  void assign(StringRef RHS) {
59
1.24k
    this->clear();
60
1.24k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
61
1.24k
  }
llvm::SmallString<128u>::assign(llvm::StringRef)
Line
Count
Source
58
131
  void assign(StringRef RHS) {
59
131
    this->clear();
60
131
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
61
131
  }
llvm::SmallString<32u>::assign(llvm::StringRef)
Line
Count
Source
58
1.05k
  void assign(StringRef RHS) {
59
1.05k
    this->clear();
60
1.05k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
61
1.05k
  }
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.0M
  void append(in_iter S, in_iter E) {
76
24.0M
    SmallVectorImpl<char>::append(S, E);
77
24.0M
  }
void llvm::SmallString<128u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
1.35M
  void append(in_iter S, in_iter E) {
76
1.35M
    SmallVectorImpl<char>::append(S, E);
77
1.35M
  }
void llvm::SmallString<256u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
30.0k
  void append(in_iter S, in_iter E) {
76
30.0k
    SmallVectorImpl<char>::append(S, E);
77
30.0k
  }
void llvm::SmallString<512u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
8.41M
  void append(in_iter S, in_iter E) {
76
8.41M
    SmallVectorImpl<char>::append(S, E);
77
8.41M
  }
void llvm::SmallString<16u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
49.8k
  void append(in_iter S, in_iter E) {
76
49.8k
    SmallVectorImpl<char>::append(S, E);
77
49.8k
  }
void llvm::SmallString<64u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
11.4M
  void append(in_iter S, in_iter E) {
76
11.4M
    SmallVectorImpl<char>::append(S, E);
77
11.4M
  }
void llvm::SmallString<32u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
466k
  void append(in_iter S, in_iter E) {
76
466k
    SmallVectorImpl<char>::append(S, E);
77
466k
  }
void llvm::SmallString<8u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
11.9k
  void append(in_iter S, in_iter E) {
76
11.9k
    SmallVectorImpl<char>::append(S, E);
77
11.9k
  }
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
656
  void append(in_iter S, in_iter E) {
76
656
    SmallVectorImpl<char>::append(S, E);
77
656
  }
void llvm::SmallString<23u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
11
  void append(in_iter S, in_iter E) {
76
11
    SmallVectorImpl<char>::append(S, E);
77
11
  }
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
2.26M
  void append(in_iter S, in_iter E) {
76
2.26M
    SmallVectorImpl<char>::append(S, E);
77
2.26M
  }
void llvm::SmallString<40u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
67
  void append(in_iter S, in_iter E) {
76
67
    SmallVectorImpl<char>::append(S, E);
77
67
  }
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.45k
  void append(in_iter S, in_iter E) {
76
3.45k
    SmallVectorImpl<char>::append(S, E);
77
3.45k
  }
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.80k
  void append(in_iter S, in_iter E) {
76
3.80k
    SmallVectorImpl<char>::append(S, E);
77
3.80k
  }
void llvm::SmallString<60u>::append<char const*>(char const*, char const*)
Line
Count
Source
75
27.7k
  void append(in_iter S, in_iter E) {
76
27.7k
    SmallVectorImpl<char>::append(S, E);
77
27.7k
  }
78
79
92.1k
  void append(size_t NumInputs, char Elt) {
80
92.1k
    SmallVectorImpl<char>::append(NumInputs, Elt);
81
92.1k
  }
llvm::SmallString<128u>::append(unsigned long, char)
Line
Count
Source
79
27
  void append(size_t NumInputs, char Elt) {
80
27
    SmallVectorImpl<char>::append(NumInputs, Elt);
81
27
  }
llvm::SmallString<256u>::append(unsigned long, char)
Line
Count
Source
79
92.1k
  void append(size_t NumInputs, char Elt) {
80
92.1k
    SmallVectorImpl<char>::append(NumInputs, Elt);
81
92.1k
  }
82
83
  /// Append from a StringRef.
84
717k
  void append(StringRef RHS) {
85
717k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
717k
  }
llvm::SmallString<128u>::append(llvm::StringRef)
Line
Count
Source
84
620k
  void append(StringRef RHS) {
85
620k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
620k
  }
llvm::SmallString<256u>::append(llvm::StringRef)
Line
Count
Source
84
96.8k
  void append(StringRef RHS) {
85
96.8k
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
96.8k
  }
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
26
  void append(StringRef RHS) {
85
26
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
26
  }
llvm::SmallString<32u>::append(llvm::StringRef)
Line
Count
Source
84
357
  void append(StringRef RHS) {
85
357
    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
86
357
  }
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
612
  bool startswith(StringRef Prefix) const {
131
612
    return str().startswith(Prefix);
132
612
  }
llvm::SmallString<128u>::startswith(llvm::StringRef) const
Line
Count
Source
130
432
  bool startswith(StringRef Prefix) const {
131
432
    return str().startswith(Prefix);
132
432
  }
llvm::SmallString<64u>::startswith(llvm::StringRef) const
Line
Count
Source
130
180
  bool startswith(StringRef Prefix) const {
131
180
    return str().startswith(Prefix);
132
180
  }
133
134
  /// endswith - Check if this string ends with the given \p Suffix.
135
39
  bool endswith(StringRef Suffix) const {
136
39
    return str().endswith(Suffix);
137
39
  }
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
  size_t find_first_of(StringRef Chars, size_t From = 0) const {
186
    return str().find_first_of(Chars, From);
187
  }
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
102
  size_t find_first_not_of(StringRef Chars, size_t From = 0) const {
200
102
    return str().find_first_not_of(Chars, From);
201
102
  }
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
3.77k
  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
247
3.77k
    return str().substr(Start, N);
248
3.77k
  }
llvm::SmallString<256u>::substr(unsigned long, unsigned long) const
Line
Count
Source
246
3.50k
  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
247
3.50k
    return str().substr(Start, N);
248
3.50k
  }
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.19M
  StringRef slice(size_t Start, size_t End) const {
261
4.19M
    return str().slice(Start, End);
262
4.19M
  }
263
264
  // Extra methods.
265
266
  /// Explicit conversion to StringRef.
267
65.4M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<128u>::str() const
Line
Count
Source
267
20.9M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<256u>::str() const
Line
Count
Source
267
1.84M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<512u>::str() const
Line
Count
Source
267
8.41M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<16u>::str() const
Line
Count
Source
267
3.36M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<32u>::str() const
Line
Count
Source
267
4.76M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<64u>::str() const
Line
Count
Source
267
20.1M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<8u>::str() const
Line
Count
Source
267
174k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<0u>::str() const
Line
Count
Source
267
12.6k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<40u>::str() const
Line
Count
Source
267
1.51M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<16384u>::str() const
Line
Count
Source
267
31.9k
  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
573
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<4096u>::str() const
Line
Count
Source
267
19.3k
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<1024u>::str() const
Line
Count
Source
267
3.95M
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<36u>::str() const
Line
Count
Source
267
26
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<24u>::str() const
Line
Count
Source
267
66
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<23u>::str() const
Line
Count
Source
267
11
  StringRef str() const { return StringRef(this->begin(), this->size()); }
llvm::SmallString<100u>::str() const
Line
Count
Source
267
195k
  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<136u>::str() const
Line
Count
Source
267
833
  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
48
  StringRef str() const { return StringRef(this->begin(), this->size()); }
268
269
  // TODO: Make this const, if it's safe...
270
473k
  const char* c_str() {
271
473k
    this->push_back(0);
272
473k
    this->pop_back();
273
473k
    return this->data();
274
473k
  }
llvm::SmallString<8u>::c_str()
Line
Count
Source
270
32.6k
  const char* c_str() {
271
32.6k
    this->push_back(0);
272
32.6k
    this->pop_back();
273
32.6k
    return this->data();
274
32.6k
  }
llvm::SmallString<128u>::c_str()
Line
Count
Source
270
439k
  const char* c_str() {
271
439k
    this->push_back(0);
272
439k
    this->pop_back();
273
439k
    return this->data();
274
439k
  }
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
206
  const char* c_str() {
271
206
    this->push_back(0);
272
206
    this->pop_back();
273
206
    return this->data();
274
206
  }
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
57.1M
  operator StringRef() const { return str(); }
llvm::SmallString<128u>::operator llvm::StringRef() const
Line
Count
Source
277
20.5M
  operator StringRef() const { return str(); }
llvm::SmallString<256u>::operator llvm::StringRef() const
Line
Count
Source
277
1.27M
  operator StringRef() const { return str(); }
llvm::SmallString<32u>::operator llvm::StringRef() const
Line
Count
Source
277
4.76M
  operator StringRef() const { return str(); }
llvm::SmallString<512u>::operator llvm::StringRef() const
Line
Count
Source
277
4.21M
  operator StringRef() const { return str(); }
llvm::SmallString<16u>::operator llvm::StringRef() const
Line
Count
Source
277
2.33M
  operator StringRef() const { return str(); }
llvm::SmallString<64u>::operator llvm::StringRef() const
Line
Count
Source
277
19.9M
  operator StringRef() const { return str(); }
llvm::SmallString<8u>::operator llvm::StringRef() const
Line
Count
Source
277
15.7k
  operator StringRef() const { return str(); }
llvm::SmallString<16384u>::operator llvm::StringRef() const
Line
Count
Source
277
31.9k
  operator StringRef() const { return str(); }
llvm::SmallString<20u>::operator llvm::StringRef() const
Line
Count
Source
277
529
  operator StringRef() const { return str(); }
llvm::SmallString<4096u>::operator llvm::StringRef() const
Line
Count
Source
277
19.3k
  operator StringRef() const { return str(); }
llvm::SmallString<24u>::operator llvm::StringRef() const
Line
Count
Source
277
66
  operator StringRef() const { return str(); }
llvm::SmallString<23u>::operator llvm::StringRef() const
Line
Count
Source
277
11
  operator StringRef() const { return str(); }
llvm::SmallString<1024u>::operator llvm::StringRef() const
Line
Count
Source
277
3.94M
  operator StringRef() const { return str(); }
llvm::SmallString<40u>::operator llvm::StringRef() const
Line
Count
Source
277
6.12k
  operator StringRef() const { return str(); }
llvm::SmallString<100u>::operator llvm::StringRef() const
Line
Count
Source
277
1.16k
  operator StringRef() const { return str(); }
llvm::SmallString<136u>::operator llvm::StringRef() const
Line
Count
Source
277
833
  operator StringRef() const { return str(); }
llvm::SmallString<0u>::operator llvm::StringRef() const
Line
Count
Source
277
12.5k
  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
48
  operator StringRef() const { return str(); }
278
279
  // Extra operators.
280
2.44M
  const SmallString &operator=(StringRef RHS) {
281
2.44M
    this->clear();
282
2.44M
    return *this += RHS;
283
2.44M
  }
llvm::SmallString<128u>::operator=(llvm::StringRef)
Line
Count
Source
280
259k
  const SmallString &operator=(StringRef RHS) {
281
259k
    this->clear();
282
259k
    return *this += RHS;
283
259k
  }
llvm::SmallString<256u>::operator=(llvm::StringRef)
Line
Count
Source
280
17.8k
  const SmallString &operator=(StringRef RHS) {
281
17.8k
    this->clear();
282
17.8k
    return *this += RHS;
283
17.8k
  }
llvm::SmallString<32u>::operator=(llvm::StringRef)
Line
Count
Source
280
155k
  const SmallString &operator=(StringRef RHS) {
281
155k
    this->clear();
282
155k
    return *this += RHS;
283
155k
  }
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
65
  const SmallString &operator=(StringRef RHS) {
281
65
    this->clear();
282
65
    return *this += RHS;
283
65
  }
llvm::SmallString<512u>::operator=(llvm::StringRef)
Line
Count
Source
280
113
  const SmallString &operator=(StringRef RHS) {
281
113
    this->clear();
282
113
    return *this += RHS;
283
113
  }
llvm::SmallString<40u>::operator=(llvm::StringRef)
Line
Count
Source
280
60
  const SmallString &operator=(StringRef RHS) {
281
60
    this->clear();
282
60
    return *this += RHS;
283
60
  }
llvm::SmallString<1024u>::operator=(llvm::StringRef)
Line
Count
Source
280
2.01M
  const SmallString &operator=(StringRef RHS) {
281
2.01M
    this->clear();
282
2.01M
    return *this += RHS;
283
2.01M
  }
llvm::SmallString<16u>::operator=(llvm::StringRef)
Line
Count
Source
280
593
  const SmallString &operator=(StringRef RHS) {
281
593
    this->clear();
282
593
    return *this += RHS;
283
593
  }
284
285
23.8M
  SmallString &operator+=(StringRef RHS) {
286
23.8M
    this->append(RHS.begin(), RHS.end());
287
23.8M
    return *this;
288
23.8M
  }
llvm::SmallString<128u>::operator+=(llvm::StringRef)
Line
Count
Source
285
1.35M
  SmallString &operator+=(StringRef RHS) {
286
1.35M
    this->append(RHS.begin(), RHS.end());
287
1.35M
    return *this;
288
1.35M
  }
llvm::SmallString<256u>::operator+=(llvm::StringRef)
Line
Count
Source
285
24.2k
  SmallString &operator+=(StringRef RHS) {
286
24.2k
    this->append(RHS.begin(), RHS.end());
287
24.2k
    return *this;
288
24.2k
  }
llvm::SmallString<512u>::operator+=(llvm::StringRef)
Line
Count
Source
285
8.41M
  SmallString &operator+=(StringRef RHS) {
286
8.41M
    this->append(RHS.begin(), RHS.end());
287
8.41M
    return *this;
288
8.41M
  }
llvm::SmallString<16u>::operator+=(llvm::StringRef)
Line
Count
Source
285
49.8k
  SmallString &operator+=(StringRef RHS) {
286
49.8k
    this->append(RHS.begin(), RHS.end());
287
49.8k
    return *this;
288
49.8k
  }
llvm::SmallString<64u>::operator+=(llvm::StringRef)
Line
Count
Source
285
11.4M
  SmallString &operator+=(StringRef RHS) {
286
11.4M
    this->append(RHS.begin(), RHS.end());
287
11.4M
    return *this;
288
11.4M
  }
llvm::SmallString<32u>::operator+=(llvm::StringRef)
Line
Count
Source
285
466k
  SmallString &operator+=(StringRef RHS) {
286
466k
    this->append(RHS.begin(), RHS.end());
287
466k
    return *this;
288
466k
  }
llvm::SmallString<8u>::operator+=(llvm::StringRef)
Line
Count
Source
285
11.9k
  SmallString &operator+=(StringRef RHS) {
286
11.9k
    this->append(RHS.begin(), RHS.end());
287
11.9k
    return *this;
288
11.9k
  }
llvm::SmallString<20u>::operator+=(llvm::StringRef)
Line
Count
Source
285
656
  SmallString &operator+=(StringRef RHS) {
286
656
    this->append(RHS.begin(), RHS.end());
287
656
    return *this;
288
656
  }
llvm::SmallString<23u>::operator+=(llvm::StringRef)
Line
Count
Source
285
11
  SmallString &operator+=(StringRef RHS) {
286
11
    this->append(RHS.begin(), RHS.end());
287
11
    return *this;
288
11
  }
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
2.06M
  SmallString &operator+=(StringRef RHS) {
286
2.06M
    this->append(RHS.begin(), RHS.end());
287
2.06M
    return *this;
288
2.06M
  }
llvm::SmallString<40u>::operator+=(llvm::StringRef)
Line
Count
Source
285
63
  SmallString &operator+=(StringRef RHS) {
286
63
    this->append(RHS.begin(), RHS.end());
287
63
    return *this;
288
63
  }
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
13.8k
  SmallString &operator+=(StringRef RHS) {
286
13.8k
    this->append(RHS.begin(), RHS.end());
287
13.8k
    return *this;
288
13.8k
  }
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
42.1k
  SmallString &operator+=(char C) {
290
42.1k
    this->push_back(C);
291
42.1k
    return *this;
292
42.1k
  }
llvm::SmallString<20u>::operator+=(char)
Line
Count
Source
289
131
  SmallString &operator+=(char C) {
290
131
    this->push_back(C);
291
131
    return *this;
292
131
  }
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.02M
  SmallString &operator+=(char C) {
290
5.02M
    this->push_back(C);
291
5.02M
    return *this;
292
5.02M
  }
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
177
  SmallString &operator+=(char C) {
290
177
    this->push_back(C);
291
177
    return *this;
292
177
  }
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