Uniques nul‐terminated strings and tracks their offsets in a contiguous allocation.

Synopsis

Declared in <llvm/TableGen/StringToOffsetTable.h>

class StringToOffsetTable;

Description

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.

Member Functions

Name

Description

StringToOffsetTable [constructor]

Construct a table that starts with the empty string at offset zero.

EmitString

Emit the aggregate string contents as a single escaped string literal.

EmitStringTableDef

Emit a string table definition named Name to OS.

GetOrAddStringOffset

Return the offset of Str, inserting it into the table if needed.

GetStringOffset

Return the offset of Str if present, otherwise std::nullopt.

empty

Return true if the offset map contains no strings.

size

Return the size in bytes of the aggregate string allocation.

Created with MrDocs