Go to the documentation of this file.
54 "Expected string buffer size"));
59 NamesBuffer.assign(Buffer.
begin(), Buffer.
end());
61 return OffsetIndexMap.load(Stream);
75 if (
auto EC = OffsetIndexMap.commit(Writer))
84 + OffsetIndexMap.calculateSerializedLength();
90 assert(NamesBuffer.size() > Offset);
91 return StringRef(NamesBuffer.data() + Offset);
99 auto Iter = OffsetIndexMap.find_as(Stream, HashTraits);
100 if (Iter == OffsetIndexMap.end())
102 StreamNo = (*Iter).second;
108 for (
const auto &Entry : OffsetIndexMap) {
109 StringRef Stream(NamesBuffer.data() + Entry.first);
110 Result.try_emplace(Stream, Entry.second);
116 uint32_t Offset = NamesBuffer.size();
118 NamesBuffer.push_back(
'\0');
void set(StringRef Stream, uint32_t StreamNo)
This is an optimization pass for GlobalISel generic memory operations.
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
StringRef storageKeyToLookupKey(uint32_t Offset) const
Error writeFixedString(StringRef Str)
Write the string Str to the underlying stream without a null terminator.
uint32_t appendStringData(StringRef S)
Provides write only access to a subclass of WritableBinaryStream.
static ErrorSuccess success()
Create a success value.
StringMap< uint32_t > entries() const
uint32_t calculateSerializedLength() const
uint32_t lookupKeyToStorageKey(StringRef S)
NamedStreamMapTraits(NamedStreamMap &NS)
Error readInteger(T &Dest)
Read an integer of the specified endianness into Dest and update the stream's offset.
StringRef getString(uint32_t Offset) const
Provides read only access to a subclass of BinaryStream.
Error commit(BinaryStreamWriter &Writer) const
uint32_t hashString(uint32_t Offset) const
Error load(BinaryStreamReader &Stream)
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
bool get(StringRef Stream, uint32_t &StreamNo) const
Error joinErrors(Error E1, Error E2)
Concatenate errors.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
Analysis the ScalarEvolution expression for r is this
void append_range(Container &C, Range &&R)
Wrapper function to append a range to a container.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Error readFixedString(StringRef &Dest, uint32_t Length)
Read a Length byte string into Dest.
Lightweight error class with error context and mandatory checking.
uint16_t hashLookupKey(StringRef S) const
uint32_t hashStringV1(StringRef Str)