diff options
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp b/llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp index c731b68625c..127868005de 100644 --- a/llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp +++ b/llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp @@ -86,6 +86,15 @@ Error DebugStringTableSubsection::commit(BinaryStreamWriter &Writer) const { uint32_t DebugStringTableSubsection::size() const { return StringToId.size(); } +std::vector<uint32_t> DebugStringTableSubsection::sortedIds() const { + std::vector<uint32_t> Result; + Result.reserve(IdToString.size()); + for (const auto &Entry : IdToString) + Result.push_back(Entry.first); + std::sort(Result.begin(), Result.end()); + return Result; +} + uint32_t DebugStringTableSubsection::getIdForString(StringRef S) const { auto Iter = StringToId.find(S); assert(Iter != StringToId.end()); |