LLVM 20.0.0git
|
A table of densely packed, null-terminated strings indexed by offset. More...
#include "llvm/ADT/StringTable.h"
Classes | |
class | Offset |
Public Member Functions | |
template<size_t N> | |
constexpr | StringTable (const char(&RawTable)[N]) |
constexpr StringRef | operator[] (Offset O) const |
constexpr size_t | size () const |
Returns the byte size of the table. | |
A table of densely packed, null-terminated strings indexed by offset.
This table abstracts a densely concatenated list of null-terminated strings, each of which can be referenced using an offset into the table.
This requires and ensures that the string at offset 0 is also the empty string. This helps allow zero-initialized offsets form empty strings and avoids non-zero initialization when using a string literal pointer would allow a null pointer.
The primary use case is having a single global string literal for the table contents, and offsets into it in other global data structures to avoid dynamic relocations of individual string literal pointers in those global data structures.
Definition at line 31 of file StringTable.h.
|
inlineconstexpr |
Definition at line 62 of file StringTable.h.
References assert(), llvm::StringRef::data(), llvm::StringRef::empty(), and llvm::StringRef::size().
Definition at line 80 of file StringTable.h.
References assert(), llvm::StringRef::data(), and llvm::StringRef::size().
|
inlineconstexpr |
Returns the byte size of the table.
Definition at line 86 of file StringTable.h.
References llvm::StringRef::size().
Referenced by llvm::object::MachOObjectFile::getIndirectName(), llvm::object::DirectX::Signature::getName(), llvm::object::DirectX::Signature::initialize(), llvm::MachOYAML::LinkEditData::isEmpty(), and writeSymbolTable().