LLVM 19.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

bool Empty () const
 
unsigned GetOrAddStringOffset (StringRef Str, bool appendZero=true)
 
void EmitString (raw_ostream &O)
 
void EmitCharArray (raw_ostream &O)
 Emit the string using character literals.
 

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 24 of file StringToOffsetTable.h.

Member Function Documentation

◆ EmitCharArray()

void llvm::StringToOffsetTable::EmitCharArray ( raw_ostream O)
inline

Emit the string using character literals.

MSVC has a limitation that string literals cannot be longer than 64K.

Definition at line 83 of file StringToOffsetTable.h.

References assert(), and llvm::CallingConv::C.

◆ EmitString()

void llvm::StringToOffsetTable::EmitString ( raw_ostream O)
inline

Definition at line 44 of file StringToOffsetTable.h.

References assert(), and llvm::raw_ostream::write_escaped().

◆ Empty()

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

Definition at line 29 of file StringToOffsetTable.h.

References llvm::StringMapImpl::empty().

◆ GetOrAddStringOffset()

unsigned llvm::StringToOffsetTable::GetOrAddStringOffset ( StringRef  Str,
bool  appendZero = true 
)
inline

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