LLVM 22.0.0git
llvm::remarks::BitstreamRemarkSerializer Struct Reference

Implementation of the remark serializer using LLVM bitstream. More...

#include "llvm/Remarks/BitstreamRemarkSerializer.h"

Inheritance diagram for llvm::remarks::BitstreamRemarkSerializer:
[legend]

Public Member Functions

 BitstreamRemarkSerializer (raw_ostream &OS)
 Construct a serializer that will create its own string table.
 BitstreamRemarkSerializer (raw_ostream &OS, StringTable StrTab)
 Construct a serializer with a pre-filled string table.
 ~BitstreamRemarkSerializer () override
void emit (const Remark &Remark) override
 Emit a remark to the stream.
void finalize () override
 Finalize emission of remarks.
std::unique_ptr< MetaSerializermetaSerializer (raw_ostream &OS, StringRef ExternalFilename) override
 The metadata serializer associated to this remark serializer.
Public Member Functions inherited from llvm::remarks::RemarkSerializer
 RemarkSerializer (Format SerializerFormat, raw_ostream &OS)
virtual ~RemarkSerializer ()=default

Static Public Member Functions

static bool classof (const RemarkSerializer *S)

Public Attributes

std::optional< BitstreamRemarkSerializerHelperHelper
 The file should contain: 1) The block info block that describes how to read the blocks.
Public Attributes inherited from llvm::remarks::RemarkSerializer
Format SerializerFormat
 The format of the serializer.
raw_ostreamOS
 The open raw_ostream that the remark diagnostics are emitted to.
std::optional< StringTableStrTab
 The string table containing all the unique strings used in the output.

Detailed Description

Implementation of the remark serializer using LLVM bitstream.

Definition at line 96 of file BitstreamRemarkSerializer.h.

Constructor & Destructor Documentation

◆ BitstreamRemarkSerializer() [1/2]

BitstreamRemarkSerializer::BitstreamRemarkSerializer ( raw_ostream & OS)

◆ BitstreamRemarkSerializer() [2/2]

BitstreamRemarkSerializer::BitstreamRemarkSerializer ( raw_ostream & OS,
StringTable StrTab )

◆ ~BitstreamRemarkSerializer()

BitstreamRemarkSerializer::~BitstreamRemarkSerializer ( )
override

Definition at line 318 of file BitstreamRemarkSerializer.cpp.

References finalize().

Member Function Documentation

◆ classof()

bool llvm::remarks::BitstreamRemarkSerializer::classof ( const RemarkSerializer * S)
inlinestatic

◆ emit()

void BitstreamRemarkSerializer::emit ( const Remark & Remark)
overridevirtual

Emit a remark to the stream.

This also emits the metadata associated to the remarks. This writes the serialized output to the provided stream.

Implements llvm::remarks::RemarkSerializer.

Definition at line 335 of file BitstreamRemarkSerializer.cpp.

References Helper, and llvm::remarks::RemarkSerializer::StrTab.

◆ finalize()

void BitstreamRemarkSerializer::finalize ( )
overridevirtual

Finalize emission of remarks.

This emits the late metadata block and flushes internal buffers. It is safe to call this function multiple times, and it is automatically executed on destruction of the Serializer.

Reimplemented from llvm::remarks::RemarkSerializer.

Definition at line 328 of file BitstreamRemarkSerializer.cpp.

References Helper, and llvm::remarks::RemarkSerializer::StrTab.

Referenced by ~BitstreamRemarkSerializer().

◆ metaSerializer()

std::unique_ptr< MetaSerializer > BitstreamRemarkSerializer::metaSerializer ( raw_ostream & OS,
StringRef ExternalFilename )
overridevirtual

The metadata serializer associated to this remark serializer.

Based on the container type of the current serializer, the container type of the metadata serializer will change.

Implements llvm::remarks::RemarkSerializer.

Definition at line 341 of file BitstreamRemarkSerializer.cpp.

References llvm::remarks::RemarkSerializer::OS, and llvm::remarks::RemarksFileExternal.

Member Data Documentation

◆ Helper

std::optional<BitstreamRemarkSerializerHelper> llvm::remarks::BitstreamRemarkSerializer::Helper

The file should contain: 1) The block info block that describes how to read the blocks.

2) The metadata block that contains various information about the remarks in the file. 3) A number of remark blocks. 4) Another metadata block for metadata that is only finalized once all remarks were emitted (e.g. StrTab) The helper to emit bitstream. This is nullopt when the Serializer has not been setup yet.

Definition at line 107 of file BitstreamRemarkSerializer.h.

Referenced by emit(), and finalize().


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