struct BitstreamRemarkSerializerHelper

Declaration

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

Description

Serialize the remarks to LLVM bitstream. This class provides ways to emit remarks in the LLVM bitstream format and its associated metadata. * The separate model: Separate meta: | Container info | String table | External file Separate remarks: | Container info | Remark version | Remark0 | Remark1 | Remark2 | ... * The standalone model: | Container info | String table | Remark version | Remark0 | Remark1 | Remark2 | ...

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:50

Member Variables

public SmallVector<char, 1024> Encoded
Buffer used for encoding the bitstream before writing it to the final stream.
public SmallVector<uint64_t, 64> R
Buffer used to construct records and pass to the bitstream writer.
public llvm::BitstreamWriter Bitstream
The Bitstream writer.
public llvm::remarks::BitstreamRemarkContainerType ContainerType
The type of the container we are serializing.
public uint64_t RecordMetaContainerInfoAbbrevID = 0
Abbrev IDs initialized in the block info block. Note: depending on the container type, some IDs might be uninitialized. Warning: When adding more abbrev IDs, make sure to update the BlockCodeSize (in the call to EnterSubblock).
public uint64_t RecordMetaRemarkVersionAbbrevID = 0
public uint64_t RecordMetaStrTabAbbrevID = 0
public uint64_t RecordMetaExternalFileAbbrevID = 0
public uint64_t RecordRemarkHeaderAbbrevID = 0
public uint64_t RecordRemarkDebugLocAbbrevID = 0
public uint64_t RecordRemarkHotnessAbbrevID = 0
public uint64_t RecordRemarkArgWithDebugLocAbbrevID = 0
public uint64_t RecordRemarkArgWithoutDebugLocAbbrevID = 0

Method Overview

Methods

BitstreamRemarkSerializerHelper(
    llvm::remarks::BitstreamRemarkContainerType
        ContainerType)

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:75

Parameters

llvm::remarks::BitstreamRemarkContainerType ContainerType

BitstreamRemarkSerializerHelper(
    const llvm::remarks::
        BitstreamRemarkSerializerHelper&)

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:80

Parameters

const llvm::remarks:: BitstreamRemarkSerializerHelper&

BitstreamRemarkSerializerHelper(
    llvm::remarks::
        BitstreamRemarkSerializerHelper&&)

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:84

Parameters

llvm::remarks::BitstreamRemarkSerializerHelper&&

void emitMetaBlock(
    uint64_t ContainerVersion,
    Optional<uint64_t> RemarkVersion,
    Optional<const llvm::remarks::StringTable*>
        StrTab = None,
    Optional<llvm::StringRef> Filename = None)

Description

Emit the metadata for the remarks.

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:107

Parameters

uint64_t ContainerVersion
Optional<uint64_t> RemarkVersion
Optional<const llvm::remarks::StringTable*> StrTab = None
Optional<llvm::StringRef> Filename = None

void emitMetaExternalFile(
    llvm::StringRef Filename)

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:101

Parameters

llvm::StringRef Filename

void emitMetaRemarkVersion(uint64_t RemarkVersion)

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:95

Parameters

uint64_t RemarkVersion

void emitMetaStrTab(
    const llvm::remarks::StringTable& StrTab)

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:98

Parameters

const llvm::remarks::StringTable& StrTab

void emitRemarkBlock(
    const llvm::remarks::Remark& Remark,
    llvm::remarks::StringTable& StrTab)

Description

Emit a remark block. The string table is required.

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:113

Parameters

const llvm::remarks::Remark& Remark
llvm::remarks::StringTable& StrTab

void flushToStream(llvm::raw_ostream& OS)

Description

Finalize the writing to \p OS.

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:115

Parameters

llvm::raw_ostream& OS

llvm::StringRef getBuffer()

Description

Finalize the writing to a buffer. The contents of the buffer remain valid for the lifetime of the object. Any call to any other function in this class will invalidate the buffer.

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:119

void setupBlockInfo()

Description

Set up the necessary block info entries according to the container type.

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:89

void setupMetaBlockInfo()

Description

Set up the block info for the metadata block.

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:92

void setupMetaExternalFile()

Description

The external file in the metadata block.

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:100

void setupMetaRemarkVersion()

Description

The remark version in the metadata block.

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:94

void setupMetaStrTab()

Description

The strtab in the metadata block.

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:97

void setupRemarkBlockInfo()

Description

The block info for the remarks block.

Declared at: llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h:104