LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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:
Inheritance graph
[legend]

Public Member Functions

 BitstreamRemarkSerializer (raw_ostream &OS, SerializerMode Mode)
 Construct a serializer that will create its own string table.
 
 BitstreamRemarkSerializer (raw_ostream &OS, SerializerMode Mode, StringTable StrTab)
 Construct a serializer with a pre-filled string table.
 
void emit (const Remark &Remark) override
 Emit a remark to the stream.
 
std::unique_ptr< MetaSerializermetaSerializer (raw_ostream &OS, std::optional< StringRef > ExternalFilename=std::nullopt) override
 The metadata serializer associated to this remark serializer.
 
- Public Member Functions inherited from llvm::remarks::RemarkSerializer
 RemarkSerializer (Format SerializerFormat, raw_ostream &OS, SerializerMode Mode)
 
virtual ~RemarkSerializer ()=default
 This is just an interface.
 
virtual void emit (const Remark &Remark)=0
 Emit a remark to the stream.
 
virtual std::unique_ptr< MetaSerializermetaSerializer (raw_ostream &OS, std::optional< StringRef > ExternalFilename=std::nullopt)=0
 Return the corresponding metadata serializer.
 

Static Public Member Functions

static bool classof (const RemarkSerializer *S)
 

Public Attributes

bool DidSetUp = false
 The file should contain: 1) The block info block that describes how to read the blocks.
 
BitstreamRemarkSerializerHelper Helper
 The helper to emit bitstream.
 
- 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.
 
SerializerMode Mode
 The serialization mode.
 
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 124 of file BitstreamRemarkSerializer.h.

Constructor & Destructor Documentation

◆ BitstreamRemarkSerializer() [1/2]

BitstreamRemarkSerializer::BitstreamRemarkSerializer ( raw_ostream OS,
SerializerMode  Mode 
)

Construct a serializer that will create its own string table.

Definition at line 329 of file BitstreamRemarkSerializer.cpp.

References assert(), llvm::remarks::RemarkSerializer::Mode, llvm::remarks::Separate, and llvm::remarks::RemarkSerializer::StrTab.

◆ BitstreamRemarkSerializer() [2/2]

BitstreamRemarkSerializer::BitstreamRemarkSerializer ( raw_ostream OS,
SerializerMode  Mode,
StringTable  StrTab 
)

Construct a serializer with a pre-filled string table.

Definition at line 340 of file BitstreamRemarkSerializer.cpp.

References llvm::remarks::RemarkSerializer::StrTab.

Member Function Documentation

◆ classof()

static 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 based on the SerializerMode specified at construction. This writes the serialized output to the provided stream.

Implements llvm::remarks::RemarkSerializer.

Definition at line 350 of file BitstreamRemarkSerializer.cpp.

References assert(), llvm::remarks::BitstreamRemarkSerializerHelper::ContainerType, DidSetUp, llvm::remarks::MetaSerializer::emit(), llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), llvm::remarks::BitstreamRemarkSerializerHelper::flushToStream(), Helper, llvm::remarks::RemarkSerializer::OS, llvm::remarks::Standalone, and llvm::remarks::RemarkSerializer::StrTab.

◆ metaSerializer()

std::unique_ptr< MetaSerializer > BitstreamRemarkSerializer::metaSerializer ( raw_ostream OS,
std::optional< StringRef ExternalFilename = std::nullopt 
)
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 371 of file BitstreamRemarkSerializer.cpp.

References assert(), llvm::remarks::BitstreamRemarkSerializerHelper::ContainerType, Helper, llvm::remarks::RemarkSerializer::OS, llvm::remarks::SeparateRemarksMeta, llvm::remarks::Standalone, and llvm::remarks::RemarkSerializer::StrTab.

Member Data Documentation

◆ DidSetUp

bool llvm::remarks::BitstreamRemarkSerializer::DidSetUp = false

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. We need to set up 1) and 2) first, so that we can emit 3) after. This flag is used to emit the first two blocks only once.

Definition at line 133 of file BitstreamRemarkSerializer.h.

Referenced by emit().

◆ Helper

BitstreamRemarkSerializerHelper llvm::remarks::BitstreamRemarkSerializer::Helper

The helper to emit bitstream.

Definition at line 135 of file BitstreamRemarkSerializer.h.

Referenced by emit(), and metaSerializer().


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