9#ifndef LLVM_ADT_STRING_TABLE_H
10#define LLVM_ADT_STRING_TABLE_H
57 return LHS.Value ==
RHS.Value;
61 return LHS.Value !=
RHS.Value;
73 static_assert(N <= std::numeric_limits<unsigned>::max(),
74 "We only support table sizes that can be indexed by an "
75 "`unsigned` offset.");
79 assert(!Table.
empty() &&
"Requires at least a valid empty string.");
80 assert(Table.
data()[0] ==
'\0' &&
"Offset zero must be the empty string.");
86 "Last byte must be a null byte.");
88 "Next-to-last byte must be a null byte.");
95 assert(O.value() < Table.
size() &&
"Out of bounds offset!");
96 return Table.
data() + O.value();
100 constexpr size_t size()
const {
return Table.
size(); }
114 : Table(&Table), O(O) {}
121 assert(Table ==
RHS.Table &&
"Compared iterators for unrelated tables!");
131 O = O.value() + (*Table)[O].size() + 1;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
bool operator==(const Iterator &RHS) const
const StringRef & operator*() const
constexpr Iterator(Iterator &&RHS)=default
constexpr Iterator(const Iterator &RHS)=default
constexpr Offset(unsigned Value)
constexpr unsigned value() const
friend constexpr bool operator==(const Offset &LHS, const Offset &RHS)
friend constexpr bool operator!=(const Offset &LHS, const Offset &RHS)
constexpr Offset()=default
A table of densely packed, null-terminated strings indexed by offset.
constexpr size_t size() const
Returns the byte size of the table.
constexpr StringRef operator[](Offset O) const
constexpr Iterator begin() const
constexpr Iterator end() const
constexpr StringTable(const char(&RawTable)[N])
LLVM Value Representation.
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
This is an optimization pass for GlobalISel generic memory operations.