56 "Expected string buffer size"));
61 NamesBuffer.assign(Buffer.
begin(), Buffer.
end());
63 return OffsetIndexMap.load(Stream);
77 if (
auto EC = OffsetIndexMap.commit(Writer))
86 + OffsetIndexMap.calculateSerializedLength();
101 auto Iter = OffsetIndexMap.find_as(Stream, HashTraits);
102 if (Iter == OffsetIndexMap.end())
104 StreamNo = (*Iter).second;
110 for (
const auto &Entry : OffsetIndexMap) {
111 StringRef Stream(NamesBuffer.data() + Entry.first);
112 Result.try_emplace(Stream, Entry.second);
120 NamesBuffer.push_back(
'\0');
void append_range(Container &C, Range &&R)
Wrapper function to append a range to a container.
uint32_t calculateSerializedLength() const
uint32_t appendStringData(StringRef S)
This class represents lattice values for constants.
Error readInteger(T &Dest)
Read an integer of the specified endianness into Dest and update the stream's offset.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
StringRef getString(uint32_t Offset) const
void set(StringRef Stream, uint32_t StreamNo)
StringRef storageKeyToLookupKey(uint32_t Offset) const
uint16_t hashLookupKey(StringRef S) const
uint32_t lookupKeyToStorageKey(StringRef S)
Error writeFixedString(StringRef Str)
Write the string Str to the underlying stream without a null terminator.
Error readFixedString(StringRef &Dest, uint32_t Length)
Read a Length byte string into Dest.
Error load(BinaryStreamReader &Stream)
StringMap< uint32_t > entries() const
uint32_t hashStringV1(StringRef Str)
Provides write only access to a subclass of WritableBinaryStream.
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
uint32_t hashString(uint32_t Offset) const
Error commit(BinaryStreamWriter &Writer) const
static ErrorSuccess success()
Create a success value.
Error joinErrors(Error E1, Error E2)
Concatenate errors.
bool get(StringRef Stream, uint32_t &StreamNo) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Provides read only access to a subclass of BinaryStream.
StringRef - Represent a constant reference to a string, i.e.
NamedStreamMapTraits(NamedStreamMap &NS)