LLDB mainline
|
Many cache files require string tables to store data efficiently. More...
#include <DataFileCache.h>
Public Member Functions | |
ConstStringTable ()=default | |
uint32_t | Add (ConstString s) |
Add a string into the string table. | |
bool | Encode (DataEncoder &encoder) |
Private Attributes | |
std::vector< ConstString > | m_strings |
llvm::DenseMap< ConstString, uint32_t > | m_string_to_offset |
uint32_t | m_next_offset = 1 |
Skip one byte to start the string table off with an empty string. | |
Many cache files require string tables to store data efficiently.
This class helps create string tables.
Definition at line 181 of file DataFileCache.h.
|
default |
uint32_t ConstStringTable::Add | ( | ConstString | s | ) |
Add a string into the string table.
Add a string to the string table will only add the same string one time and will return the offset in the string table buffer to that string. String tables are easy to build with ConstString objects since most LLDB classes for symbol or debug info use them already and they provide permanent storage for the string.
s | The string to insert into the string table. |
Definition at line 266 of file DataFileCache.cpp.
References lldb_private::ConstString::GetLength(), m_next_offset, m_string_to_offset, and m_strings.
Referenced by lldb_private::Mangled::Encode(), lldb_private::plugin::dwarf::NameToDIE::Encode(), and EncodeCStrMap().
bool ConstStringTable::Encode | ( | DataEncoder & | encoder | ) |
Definition at line 279 of file DataFileCache.cpp.
References lldb_private::DataEncoder::AppendCString(), lldb_private::DataEncoder::AppendData(), lldb_private::DataEncoder::AppendU32(), lldb_private::DataEncoder::AppendU8(), lldb_private::DataEncoder::GetByteSize(), kStringTableIdentifier(), m_string_to_offset, m_strings, and lldb_private::DataEncoder::PutU32().
Referenced by lldb_private::Symtab::Encode(), and lldb_private::plugin::dwarf::ManualDWARFIndex::IndexSet::Encode().
|
private |
Skip one byte to start the string table off with an empty string.
Definition at line 207 of file DataFileCache.h.
Referenced by Add().
|
private |
Definition at line 205 of file DataFileCache.h.
|
private |
Definition at line 204 of file DataFileCache.h.