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) {
81 assert((End - Begin) == StringSize);
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);
98 assert(Iter != StringToId.end());
103 auto Iter = IdToString.
find(Id);
104 assert(Iter != IdToString.end());
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Provides read only access to a subclass of BinaryStream.
LLVM_ABI Error readStreamRef(BinaryStreamRef &Ref)
Read the entire remainder of the underlying stream into Ref.
LLVM_ABI 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.
LLVM_ABI 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.
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
size_t find(char C, size_t From=0) const
Search for the first character C in the string.
LLVM_ABI Expected< StringRef > getString(uint32_t Offset) const
LLVM_ABI DebugStringTableSubsectionRef()
LLVM_ABI 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
DebugSubsectionRef(DebugSubsectionKind Kind)
DebugSubsection(DebugSubsectionKind Kind)
This is an optimization pass for GlobalISel generic memory operations.
void sort(IteratorTy Start, IteratorTy End)