LLVM  10.0.0svn
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"

Collaboration diagram for llvm::remarks::BitstreamRemarkSerializerHelper:
Collaboration graph
[legend]

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. More...
 
void setupMetaBlockInfo ()
 Set up the block info for the metadata block. More...
 
void setupMetaRemarkVersion ()
 The remark version in the metadata block. More...
 
void emitMetaRemarkVersion (uint64_t RemarkVersion)
 
void setupMetaStrTab ()
 The strtab in the metadata block. More...
 
void emitMetaStrTab (const StringTable &StrTab)
 
void setupMetaExternalFile ()
 The external file in the metadata block. More...
 
void emitMetaExternalFile (StringRef Filename)
 
void setupRemarkBlockInfo ()
 The block info for the remarks block. More...
 
void emitMetaBlock (uint64_t ContainerVersion, Optional< uint64_t > RemarkVersion, Optional< const StringTable *> StrTab=None, Optional< StringRef > Filename=None)
 Emit the metadata for the remarks. More...
 
void emitRemarkBlock (const Remark &Remark, StringTable &StrTab)
 Emit a remark block. The string table is required. More...
 
void flushToStream (raw_ostream &OS)
 Finalize the writing to OS. More...
 
StringRef getBuffer ()
 Finalize the writing to a buffer. More...
 

Public Attributes

SmallVector< char, 1024 > Encoded
 Buffer used for encoding the bitstream before writing it to the final stream. More...
 
SmallVector< uint64_t, 64 > R
 Buffer used to construct records and pass to the bitstream writer. More...
 
BitstreamWriter Bitstream
 The Bitstream writer. More...
 
BitstreamRemarkContainerType ContainerType
 The type of the container we are serializing. More...
 
uint64_t RecordMetaContainerInfoAbbrevID = 0
 Abbrev IDs initialized in the block info block. More...
 
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 49 of file BitstreamRemarkSerializer.h.

Constructor & Destructor Documentation

◆ BitstreamRemarkSerializerHelper() [1/3]

BitstreamRemarkSerializerHelper::BitstreamRemarkSerializerHelper ( BitstreamRemarkContainerType  ContainerType)

Definition at line 19 of file BitstreamRemarkSerializer.cpp.

References llvm::remarks::Bitstream.

◆ 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,
Optional< uint64_t >  RemarkVersion,
Optional< const StringTable *>  StrTab = None,
Optional< StringRef Filename = None 
)

◆ 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 323 of file BitstreamRemarkSerializer.cpp.

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

BitstreamRemarkSerializerHelper& llvm::remarks::BitstreamRemarkSerializerHelper::operator= ( 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 52 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 64 of file BitstreamRemarkSerializer.h.

Referenced by emitMetaBlock(), and setupMetaBlockInfo().

◆ RecordMetaExternalFileAbbrevID

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

Definition at line 67 of file BitstreamRemarkSerializer.h.

Referenced by emitMetaExternalFile(), and setupMetaExternalFile().

◆ RecordMetaRemarkVersionAbbrevID

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

Definition at line 65 of file BitstreamRemarkSerializer.h.

Referenced by emitMetaRemarkVersion(), and setupMetaRemarkVersion().

◆ RecordMetaStrTabAbbrevID

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

Definition at line 66 of file BitstreamRemarkSerializer.h.

Referenced by emitMetaStrTab(), and setupMetaStrTab().

◆ RecordRemarkArgWithDebugLocAbbrevID

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

Definition at line 71 of file BitstreamRemarkSerializer.h.

Referenced by emitRemarkBlock(), and setupRemarkBlockInfo().

◆ RecordRemarkArgWithoutDebugLocAbbrevID

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

Definition at line 72 of file BitstreamRemarkSerializer.h.

Referenced by emitRemarkBlock(), and setupRemarkBlockInfo().

◆ RecordRemarkDebugLocAbbrevID

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

Definition at line 69 of file BitstreamRemarkSerializer.h.

Referenced by emitRemarkBlock(), and setupRemarkBlockInfo().

◆ RecordRemarkHeaderAbbrevID

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

Definition at line 68 of file BitstreamRemarkSerializer.h.

Referenced by emitRemarkBlock(), and setupRemarkBlockInfo().

◆ RecordRemarkHotnessAbbrevID

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

Definition at line 70 of file BitstreamRemarkSerializer.h.

Referenced by emitRemarkBlock(), and setupRemarkBlockInfo().


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