LLVM 22.0.0git
|
A table of densely packed, null-terminated strings indexed by offset. More...
#include "llvm/ADT/StringTable.h"
Classes | |
class | Iterator |
class | Offset |
Public Member Functions | |
template<size_t N> | |
constexpr | StringTable (const char(&RawTable)[N]) |
constexpr const char * | getCString (Offset O) const |
constexpr StringRef | operator[] (Offset O) const |
constexpr size_t | size () const |
Returns the byte size of the table. | |
constexpr Iterator | begin () const |
constexpr Iterator | end () const |
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 33 of file StringTable.h.
|
inlineconstexpr |
Definition at line 72 of file StringTable.h.
References assert(), llvm::StringRef::data(), llvm::StringRef::empty(), and llvm::StringRef::size().
|
inlineconstexpr |
Definition at line 146 of file StringTable.h.
|
inlineconstexpr |
Definition at line 147 of file StringTable.h.
References size().
Referenced by llvm::logicalview::LVStringPool::findIndex().
Definition at line 90 of file StringTable.h.
References assert(), llvm::StringRef::data(), and llvm::StringRef::size().
Referenced by llvm::RTLIB::RuntimeLibcallsInfo::getLibcallImplName(), and operator[]().
Definition at line 98 of file StringTable.h.
References getCString().
|
inlineconstexpr |
Returns the byte size of the table.
Definition at line 101 of file StringTable.h.
References llvm::StringRef::size().
Referenced by end(), llvm::object::MachOObjectFile::getIndirectName(), llvm::object::DirectX::Signature::getName(), llvm::object::DirectX::Signature::initialize(), llvm::MachOYAML::LinkEditData::isEmpty(), and writeSymbolTable().