struct StringTable

Declaration

struct StringTable { /* full declaration omitted */ };

Description

The string table used for serializing remarks. This table can be for example serialized in a section to be consumed after the compilation.

Declared at: llvm/include/llvm/Remarks/RemarkStringTable.h:35

Member Variables

public StringMap<unsigned int, llvm::BumpPtrAllocator> StrTab
The string table containing all the unique strings used in the output. It maps a string to an unique ID.
public size_t SerializedSize = 0
Total size of the string table when serialized.

Method Overview

  • public StringTable()
  • public StringTable(const llvm::remarks::StringTable &)
  • public StringTable(llvm::remarks::StringTable &&)
  • public StringTable(const llvm::remarks::ParsedStringTable & Other)
  • public std::pair<unsigned int, StringRef> add(llvm::StringRef Str)
  • public void internalize(llvm::remarks::Remark & R)
  • public void serialize(llvm::raw_ostream & OS) const
  • public std::vector<StringRef> serialize() const

Methods

StringTable()

Declared at: llvm/include/llvm/Remarks/RemarkStringTable.h:42

StringTable(const llvm::remarks::StringTable&)

Description

Disable copy.

Declared at: llvm/include/llvm/Remarks/RemarkStringTable.h:45

Parameters

const llvm::remarks::StringTable&

StringTable(llvm::remarks::StringTable&&)

Description

Should be movable.

Declared at: llvm/include/llvm/Remarks/RemarkStringTable.h:48

Parameters

llvm::remarks::StringTable&&

StringTable(
    const llvm::remarks::ParsedStringTable& Other)

Description

Construct a string table from a ParsedStringTable.

Declared at: llvm/include/llvm/Remarks/RemarkStringTable.h:52

Parameters

const llvm::remarks::ParsedStringTable& Other

std::pair<unsigned int, StringRef> add(
    llvm::StringRef Str)

Description

Add a string to the table. It returns an unique ID of the string.

Declared at: llvm/include/llvm/Remarks/RemarkStringTable.h:55

Parameters

llvm::StringRef Str

void internalize(llvm::remarks::Remark& R)

Description

Modify \p R to use strings from this string table. If the string table does not contain the strings, it adds them.

Declared at: llvm/include/llvm/Remarks/RemarkStringTable.h:58

Parameters

llvm::remarks::Remark& R

void serialize(llvm::raw_ostream& OS) const

Description

Serialize the string table to a stream. It is serialized as a little endian uint64 (the size of the table in bytes) followed by a sequence of NULL-terminated strings, where the N-th string is the string with the ID N in the StrTab map.

Declared at: llvm/include/llvm/Remarks/RemarkStringTable.h:63

Parameters

llvm::raw_ostream& OS

std::vector<StringRef> serialize() const

Description

Serialize the string table to a vector. This allows users to do the actual writing to file/memory/other. The string with the ID == N should be the N-th element in the vector.

Declared at: llvm/include/llvm/Remarks/RemarkStringTable.h:67