LLVM 22.0.0git
|
StringToOffsetTable - This class uniques a bunch of nul-terminated strings and keeps track of their offset in a massive contiguous string allocation. More...
#include "llvm/TableGen/StringToOffsetTable.h"
Public Member Functions | |
StringToOffsetTable (bool AppendZero=true, StringRef ClassPrefix="") | |
bool | empty () const |
size_t | size () const |
unsigned | GetOrAddStringOffset (StringRef Str) |
std::optional< unsigned > | GetStringOffset (StringRef Str) const |
void | EmitStringTableDef (raw_ostream &OS, const Twine &Name) const |
void | EmitString (raw_ostream &O) const |
StringToOffsetTable - This class uniques a bunch of nul-terminated strings and keeps track of their offset in a massive contiguous string allocation.
It can then output this string blob and use indexes into the string to reference each piece.
Definition at line 23 of file StringToOffsetTable.h.
|
inline |
Definition at line 33 of file StringToOffsetTable.h.
References GetOrAddStringOffset().
void StringToOffsetTable::EmitString | ( | raw_ostream & | O | ) | const |
Definition at line 81 of file StringToOffsetTable.cpp.
void StringToOffsetTable::EmitStringTableDef | ( | raw_ostream & | OS, |
const Twine & | Name ) const |
Definition at line 29 of file StringToOffsetTable.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::CallingConv::C, llvm::EmitLongStrLiterals, llvm::formatv(), llvm::SmallVectorTemplateCommon< T, typename >::front(), llvm::SmallVectorTemplateBase< T, bool >::pop_back(), llvm::PrintFatalError(), llvm::split(), and llvm::raw_ostream::write_escaped().
|
inline |
Definition at line 40 of file StringToOffsetTable.h.
Definition at line 17 of file StringToOffsetTable.cpp.
Referenced by StringToOffsetTable().
Definition at line 47 of file StringToOffsetTable.h.
References II.
|
inline |
Definition at line 41 of file StringToOffsetTable.h.
Referenced by GetOrAddStringOffset().