13 #ifndef LLVM_DEMANGLE_STRINGVIEW_H 14 #define LLVM_DEMANGLE_STRINGVIEW_H 28 StringView(
const char (&Str)[
N]) : First(Str), Last(Str + N - 1) {}
30 : First(First_), Last(Last_) {}
32 : First(First_), Last(First_ + Len) {}
33 StringView(
const char *Str) : First(Str), Last(Str +
std::strlen(Str)) {}
41 size_t FindBegin = std::min(
From,
size());
43 if (FindBegin <
size()) {
45 if (
const void *
P = ::memchr(First + FindBegin, C,
size() - FindBegin))
46 return static_cast<const char *
>(
P) - First;
110 const char *
begin()
const {
return First; }
111 const char *
end()
const {
return Last; }
112 size_t size()
const {
return static_cast<size_t>(Last - First); }
113 bool empty()
const {
return First == Last; }
bool startsWith(char C) const
StringView dropFront(size_t N=1) const
StringView(const char *Str)
bool startsWith(StringView Str) const
size_t find(char C, size_t From=0) const
StringView dropBack(size_t N=1) const
StringView(const char *First_, const char *Last_)
bool consumeFront(StringView S)
const char * begin() const
StringView(const char(&Str)[N])
StringView substr(size_t From) const
StringView(const char *First_, size_t Len)
BlockVerifier::State From
StringView substr(size_t From, size_t To) const
bool operator==(const StringView &LHS, const StringView &RHS)
const char & operator[](size_t Idx) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool consumeFront(char C)