LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::remarks::BitstreamRemarkSerializerHelper Struct Reference

Serialize the remarks to LLVM bitstream. More...

#include "llvm/Remarks/BitstreamRemarkSerializer.h"

Public Member Functions

 BitstreamRemarkSerializerHelper (BitstreamRemarkContainerType ContainerType)
 
 BitstreamRemarkSerializerHelper (const BitstreamRemarkSerializerHelper &)=delete
 
BitstreamRemarkSerializerHelperoperator= (const BitstreamRemarkSerializerHelper &)=delete
 
 BitstreamRemarkSerializerHelper (BitstreamRemarkSerializerHelper &&)=delete
 
BitstreamRemarkSerializerHelperoperator= (BitstreamRemarkSerializerHelper &&)=delete
 
void setupBlockInfo ()
 Set up the necessary block info entries according to the container type.
 
void setupMetaBlockInfo ()
 Set up the block info for the metadata block.
 
void setupMetaRemarkVersion ()
 The remark version in the metadata block.
 
void emitMetaRemarkVersion (uint64_t RemarkVersion)
 
void setupMetaStrTab ()
 The strtab in the metadata block.
 
void emitMetaStrTab (const StringTable &StrTab)
 
void setupMetaExternalFile ()
 The external file in the metadata block.
 
void emitMetaExternalFile (StringRef Filename)
 
void setupRemarkBlockInfo ()
 The block info for the remarks block.
 
void emitMetaBlock (uint64_t ContainerVersion, std::optional< uint64_t > RemarkVersion, std::optional< const StringTable * > StrTab=std::nullopt, std::optional< StringRef > Filename=std::nullopt)
 Emit the metadata for the remarks.
 
void emitRemarkBlock (const Remark &Remark, StringTable &StrTab)
 Emit a remark block. The string table is required.
 
void flushToStream (raw_ostream &OS)
 Finalize the writing to OS.
 
StringRef getBuffer ()
 Finalize the writing to a buffer.
 

Public Attributes

SmallVector< char, 1024 > Encoded
 Buffer used for encoding the bitstream before writing it to the final stream.
 
SmallVector< uint64_t, 64 > R
 Buffer used to construct records and pass to the bitstream writer.
 
BitstreamWriter Bitstream
 The Bitstream writer.
 
BitstreamRemarkContainerType ContainerType
 The type of the container we are serializing.
 
uint64_t RecordMetaContainerInfoAbbrevID = 0
 Abbrev IDs initialized in the block info block.
 
uint64_t RecordMetaRemarkVersionAbbrevID = 0
 
uint64_t RecordMetaStrTabAbbrevID = 0
 
uint64_t RecordMetaExternalFileAbbrevID = 0
 
uint64_t RecordRemarkHeaderAbbrevID = 0
 
uint64_t RecordRemarkDebugLocAbbrevID = 0
 
uint64_t RecordRemarkHotnessAbbrevID = 0
 
uint64_t RecordRemarkArgWithDebugLocAbbrevID = 0
 
uint64_t RecordRemarkArgWithoutDebugLocAbbrevID = 0
 

Detailed Description

Serialize the remarks to LLVM bitstream.

This class provides ways to emit remarks in the LLVM bitstream format and its associated metadata.

Definition at line 51 of file BitstreamRemarkSerializer.h.

Constructor & Destructor Documentation

◆ BitstreamRemarkSerializerHelper() [1/3]

BitstreamRemarkSerializerHelper::BitstreamRemarkSerializerHelper ( BitstreamRemarkContainerType  ContainerType)

Definition at line 21 of file BitstreamRemarkSerializer.cpp.

◆ BitstreamRemarkSerializerHelper() [2/3]

llvm::remarks::BitstreamRemarkSerializerHelper::BitstreamRemarkSerializerHelper ( const BitstreamRemarkSerializerHelper )
delete

◆ BitstreamRemarkSerializerHelper() [3/3]

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

Member Function Documentation

◆ emitMetaBlock()

void BitstreamRemarkSerializerHelper::emitMetaBlock ( uint64_t  ContainerVersion,
std::optional< uint64_t RemarkVersion,
std::optional< const StringTable * >  StrTab = std::nullopt,
std::optional< StringRef Filename = std::nullopt 
)

◆ emitMetaExternalFile()

void BitstreamRemarkSerializerHelper::emitMetaExternalFile ( StringRef  Filename)

◆ emitMetaRemarkVersion()

void BitstreamRemarkSerializerHelper::emitMetaRemarkVersion ( uint64_t  RemarkVersion)

◆ emitMetaStrTab()

void BitstreamRemarkSerializerHelper::emitMetaStrTab ( const StringTable StrTab)

◆ emitRemarkBlock()

void BitstreamRemarkSerializerHelper::emitRemarkBlock ( const Remark Remark,
StringTable StrTab 
)

◆ flushToStream()

void BitstreamRemarkSerializerHelper::flushToStream ( raw_ostream OS)

◆ getBuffer()

StringRef BitstreamRemarkSerializerHelper::getBuffer ( )

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.

Definition at line 325 of file BitstreamRemarkSerializer.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::data(), Encoded, and llvm::SmallVectorBase< Size_T >::size().

◆ operator=() [1/2]

BitstreamRemarkSerializerHelper & llvm::remarks::BitstreamRemarkSerializerHelper::operator= ( BitstreamRemarkSerializerHelper &&  )
delete

◆ operator=() [2/2]

BitstreamRemarkSerializerHelper & llvm::remarks::BitstreamRemarkSerializerHelper::operator= ( const BitstreamRemarkSerializerHelper )
delete

◆ setupBlockInfo()

void BitstreamRemarkSerializerHelper::setupBlockInfo ( )

◆ setupMetaBlockInfo()

void BitstreamRemarkSerializerHelper::setupMetaBlockInfo ( )

◆ setupMetaExternalFile()

void BitstreamRemarkSerializerHelper::setupMetaExternalFile ( )

◆ setupMetaRemarkVersion()

void BitstreamRemarkSerializerHelper::setupMetaRemarkVersion ( )

◆ setupMetaStrTab()

void BitstreamRemarkSerializerHelper::setupMetaStrTab ( )

◆ setupRemarkBlockInfo()

void BitstreamRemarkSerializerHelper::setupRemarkBlockInfo ( )

Member Data Documentation

◆ Bitstream

BitstreamWriter llvm::remarks::BitstreamRemarkSerializerHelper::Bitstream

◆ ContainerType

BitstreamRemarkContainerType llvm::remarks::BitstreamRemarkSerializerHelper::ContainerType

◆ Encoded

SmallVector<char, 1024> llvm::remarks::BitstreamRemarkSerializerHelper::Encoded

Buffer used for encoding the bitstream before writing it to the final stream.

Definition at line 54 of file BitstreamRemarkSerializer.h.

Referenced by flushToStream(), and getBuffer().

◆ R

SmallVector<uint64_t, 64> llvm::remarks::BitstreamRemarkSerializerHelper::R

◆ RecordMetaContainerInfoAbbrevID

uint64_t llvm::remarks::BitstreamRemarkSerializerHelper::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).

Definition at line 66 of file BitstreamRemarkSerializer.h.

Referenced by emitMetaBlock(), and setupMetaBlockInfo().

◆ RecordMetaExternalFileAbbrevID

uint64_t llvm::remarks::BitstreamRemarkSerializerHelper::RecordMetaExternalFileAbbrevID = 0

Definition at line 69 of file BitstreamRemarkSerializer.h.

Referenced by emitMetaExternalFile(), and setupMetaExternalFile().

◆ RecordMetaRemarkVersionAbbrevID

uint64_t llvm::remarks::BitstreamRemarkSerializerHelper::RecordMetaRemarkVersionAbbrevID = 0

Definition at line 67 of file BitstreamRemarkSerializer.h.

Referenced by emitMetaRemarkVersion(), and setupMetaRemarkVersion().

◆ RecordMetaStrTabAbbrevID

uint64_t llvm::remarks::BitstreamRemarkSerializerHelper::RecordMetaStrTabAbbrevID = 0

Definition at line 68 of file BitstreamRemarkSerializer.h.

Referenced by emitMetaStrTab(), and setupMetaStrTab().

◆ RecordRemarkArgWithDebugLocAbbrevID

uint64_t llvm::remarks::BitstreamRemarkSerializerHelper::RecordRemarkArgWithDebugLocAbbrevID = 0

Definition at line 73 of file BitstreamRemarkSerializer.h.

Referenced by emitRemarkBlock(), and setupRemarkBlockInfo().

◆ RecordRemarkArgWithoutDebugLocAbbrevID

uint64_t llvm::remarks::BitstreamRemarkSerializerHelper::RecordRemarkArgWithoutDebugLocAbbrevID = 0

Definition at line 74 of file BitstreamRemarkSerializer.h.

Referenced by emitRemarkBlock(), and setupRemarkBlockInfo().

◆ RecordRemarkDebugLocAbbrevID

uint64_t llvm::remarks::BitstreamRemarkSerializerHelper::RecordRemarkDebugLocAbbrevID = 0

Definition at line 71 of file BitstreamRemarkSerializer.h.

Referenced by emitRemarkBlock(), and setupRemarkBlockInfo().

◆ RecordRemarkHeaderAbbrevID

uint64_t llvm::remarks::BitstreamRemarkSerializerHelper::RecordRemarkHeaderAbbrevID = 0

Definition at line 70 of file BitstreamRemarkSerializer.h.

Referenced by emitRemarkBlock(), and setupRemarkBlockInfo().

◆ RecordRemarkHotnessAbbrevID

uint64_t llvm::remarks::BitstreamRemarkSerializerHelper::RecordRemarkHotnessAbbrevID = 0

Definition at line 72 of file BitstreamRemarkSerializer.h.

Referenced by emitRemarkBlock(), and setupRemarkBlockInfo().


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