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