LLVM 22.0.0git
Public Member Functions | List of all members
llvm::StringToOffsetTable Class Reference

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< unsignedGetStringOffset (StringRef Str) const
 
void EmitStringTableDef (raw_ostream &OS, const Twine &Name) const
 
void EmitString (raw_ostream &O) const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ StringToOffsetTable()

llvm::StringToOffsetTable::StringToOffsetTable ( bool  AppendZero = true,
StringRef  ClassPrefix = "" 
)
inline

Definition at line 33 of file StringToOffsetTable.h.

References GetOrAddStringOffset().

Member Function Documentation

◆ EmitString()

void StringToOffsetTable::EmitString ( raw_ostream O) const

◆ EmitStringTableDef()

void StringToOffsetTable::EmitStringTableDef ( raw_ostream OS,
const Twine Name 
) const

◆ empty()

bool llvm::StringToOffsetTable::empty ( ) const
inline

Definition at line 40 of file StringToOffsetTable.h.

References llvm::StringMapImpl::empty().

◆ GetOrAddStringOffset()

unsigned StringToOffsetTable::GetOrAddStringOffset ( StringRef  Str)

◆ GetStringOffset()

std::optional< unsigned > llvm::StringToOffsetTable::GetStringOffset ( StringRef  Str) const
inline

◆ size()

size_t llvm::StringToOffsetTable::size ( ) const
inline

Definition at line 41 of file StringToOffsetTable.h.

Referenced by GetOrAddStringOffset().


The documentation for this class was generated from the following files: