14#ifndef LLVM_ADT_SMALLSTRING_H
15#define LLVM_ADT_SMALLSTRING_H
25template<
unsigned InternalLen>
41 template<
typename ItTy>
56 void assign(std::initializer_list<StringRef> Refs) {
73 void append(std::initializer_list<StringRef> Refs) {
74 size_t CurrentSize = this->
size();
75 size_t SizeNeeded = CurrentSize;
77 SizeNeeded +=
Ref.size();
80 std::copy(
Ref.begin(),
Ref.end(), this->begin() + CurrentSize);
81 CurrentSize +=
Ref.size();
137 [[nodiscard]]
size_t find(
char C,
size_t From = 0)
const {
188 size_t From = 0)
const {
268 explicit operator std::string()
const {
269 return std::string(this->
data(), this->
size());
BlockVerifier::State From
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const MachineOperand & RHS
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
size_t rfind(StringRef Str) const
Search for the last string Str in the string.
size_t find_first_of(StringRef Chars, size_t From=0) const
Find the first character in the string that is in Chars, or npos if not found.
SmallString(StringRef S)
Initialize from a StringRef.
size_t find_last_of(StringRef Chars, size_t From=StringRef::npos) const
Find the last character in the string that is in C, or npos if not found.
size_t find_last_of(char C, size_t From=StringRef::npos) const
Find the last character in the string that is C, or npos if not found.
SmallString & operator=(StringRef RHS)
void assign(std::initializer_list< StringRef > Refs)
Assign from a list of StringRefs.
SmallString()=default
Default ctor - Initialize to empty.
size_t find(char C, size_t From=0) const
find - Search for the first character C in the string.
bool ends_with(StringRef Suffix) const
ends_with - Check if this string ends with the given Suffix.
size_t find(StringRef Str, size_t From=0) const
Search for the first string Str in the string.
bool equals(StringRef RHS) const
Check for string equality.
size_t count(StringRef Str) const
Return the number of non-overlapped occurrences of Str in the string.
StringRef slice(size_t Start, size_t End) const
Return a reference to the substring from [Start, End).
size_t rfind(char C, size_t From=StringRef::npos) const
Search for the last character C in the string.
void append(std::initializer_list< StringRef > Refs)
Append from a list of StringRefs.
SmallString & operator+=(char C)
void assign(StringRef RHS)
Assign from a StringRef.
SmallString & operator+=(StringRef RHS)
bool equals_insensitive(StringRef RHS) const
Check for string equality, ignoring case.
int compare_numeric(StringRef RHS) const
compare_numeric - Compare two strings, treating sequences of digits as numbers.
int compare(StringRef RHS) const
compare - Compare two strings; the result is negative, zero, or positive if this string is lexicograp...
bool starts_with(StringRef Prefix) const
starts_with - Check if this string starts with the given Prefix.
StringRef substr(size_t Start, size_t N=StringRef::npos) const
Return a reference to the substring from [Start, Start + N).
size_t find_first_not_of(StringRef Chars, size_t From=0) const
Find the first character in the string that is not in the string Chars, or npos if not found.
void append(StringRef RHS)
Append from a StringRef.
SmallString(ItTy S, ItTy E)
Initialize with a range.
int compare_insensitive(StringRef RHS) const
compare_insensitive - Compare two strings, ignoring case.
size_t count(char C) const
Return the number of occurrences of C in the string.
size_t find_first_of(char C, size_t From=0) const
Find the first character in the string that is C, or npos if not found.
SmallString(std::initializer_list< StringRef > Refs)
Initialize by concatenating a list of StringRefs.
StringRef str() const
Explicit conversion to StringRef.
size_t find_first_not_of(char C, size_t From=0) const
Find the first character in the string that is not C or npos if not found.
void resize_for_overwrite(size_type N)
Like resize, but T is POD, the new values won't be initialized.
void assign(size_type NumElts, ValueParamT Elt)
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
void push_back(const T &Elt)
pointer data()
Return a pointer to the vector's buffer, even if empty().
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
StringRef slice(size_t Start, size_t End) const
Return a reference to the substring from [Start, End).
size_t find_last_of(char C, size_t From=npos) const
Find the last character in the string that is C, or npos if not found.
int compare_numeric(StringRef RHS) const
compare_numeric - Compare two strings, treating sequences of digits as numbers.
size_t find_first_of(char C, size_t From=0) const
Find the first character in the string that is C, or npos if not found.
size_t rfind(char C, size_t From=npos) const
Search for the last character C in the string.
size_t find(char C, size_t From=0) const
Search for the first character C in the string.
size_t count(char C) const
Return the number of occurrences of C in the string.
bool ends_with(StringRef Suffix) const
Check if this string ends with the given Suffix.
static constexpr size_t npos
int compare(StringRef RHS) const
compare - Compare two strings; the result is negative, zero, or positive if this string is lexicograp...
bool equals_insensitive(StringRef RHS) const
Check for string equality, ignoring case.
size_t find_first_not_of(char C, size_t From=0) const
Find the first character in the string that is not C or npos if not found.
int compare_insensitive(StringRef RHS) const
Compare two strings, ignoring case.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
@ Ref
The access may reference the value stored in memory.