49 auto P = StringToId.
insert({S, StringSize});
54 IdToString.insert({
P.first->getValue(),
P.first->getKey()});
55 StringSize += S.
size() + 1;
58 return P.first->second;
73 for (
auto &Pair : StringToId) {
83 assert((End - Begin) == StringSize);
90 std::vector<uint32_t> Result;
91 Result.reserve(IdToString.size());
92 for (
const auto &Entry : IdToString)
93 Result.push_back(Entry.first);
99 auto Iter = StringToId.
find(S);
105 auto Iter = IdToString.find(Id);
106 assert(Iter != IdToString.end());
StringRef getStringForId(uint32_t Id) const
This class represents lattice values for constants.
uint32_t calculateSerializedSize() const override
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
iterator find(StringRef Key)
Error commit(BinaryStreamWriter &Writer) const override
Expected< StringRef > getString(uint32_t Offset) const
std::vector< uint32_t > sortedIds() const
Tagged union holding either a T or a Error.
Error readCString(StringRef &Dest)
Read a null terminated string from Dest.
uint32_t getIdForString(StringRef S) const
DebugStringTableSubsection()
uint32_t getOffset() const
Provides write only access to a subclass of WritableBinaryStream.
void sort(IteratorTy Start, IteratorTy End)
Error writeCString(StringRef Str)
Write the string Str to the underlying stream followed by a null terminator.
void setOffset(uint32_t Off)
static ErrorSuccess success()
Create a success value.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Error initialize(BinaryStreamRef Contents)
void setOffset(uint32_t Off)
uint32_t insert(StringRef S)
Error readStreamRef(BinaryStreamRef &Ref)
Read the entire remainder of the underlying stream into Ref.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
DebugStringTableSubsectionRef()
Lightweight error class with error context and mandatory checking.
Provides read only access to a subclass of BinaryStream.
StringRef - Represent a constant reference to a string, i.e.