47 auto P = StringToId.
insert({S, StringSize});
52 IdToString.insert({
P.first->getValue(),
P.first->getKey()});
53 StringSize += S.
size() + 1;
56 return P.first->second;
71 for (
auto &Pair : StringToId) {
88 std::vector<uint32_t> Result;
89 Result.reserve(IdToString.size());
90 for (
const auto &Entry : IdToString)
91 Result.push_back(Entry.first);
97 auto Iter = StringToId.
find(S);
103 auto Iter = IdToString.find(Id);
104 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.
A table of densely packed, null-terminated strings indexed by offset.
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)