LLVM 22.0.0git
llvm::remarks::RemarkSerializer Struct Referenceabstract

This is the base class for a remark serializer. More...

#include "llvm/Remarks/RemarkSerializer.h"

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

Public Member Functions

 RemarkSerializer (Format SerializerFormat, raw_ostream &OS)
virtual ~RemarkSerializer ()=default
virtual void finalize ()
 Finalize remark emission (e.g.
virtual void emit (const Remark &Remark)=0
 Emit a remark to the stream.
virtual std::unique_ptr< MetaSerializermetaSerializer (raw_ostream &OS, StringRef ExternalFilename)=0
 Return the corresponding metadata serializer.

Public Attributes

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

This is the base class for a remark serializer.

It includes support for using a string table while emitting.

Definition at line 33 of file RemarkSerializer.h.

Constructor & Destructor Documentation

◆ RemarkSerializer()

◆ ~RemarkSerializer()

virtual llvm::remarks::RemarkSerializer::~RemarkSerializer ( )
virtualdefault

Member Function Documentation

◆ emit()

virtual void llvm::remarks::RemarkSerializer::emit ( const Remark & Remark)
pure virtual

Emit a remark to the stream.

Implemented in llvm::remarks::BitstreamRemarkSerializer, and llvm::remarks::YAMLRemarkSerializer.

◆ finalize()

virtual void llvm::remarks::RemarkSerializer::finalize ( )
inlinevirtual

Finalize remark emission (e.g.

finish writing metadata, flush internal buffers). It is safe to call this function multiple times, and it should have the same behavior as destructing the RemarkSerializer. After finalizing, the behavior of emit is unspecified.

Reimplemented in llvm::remarks::BitstreamRemarkSerializer.

Definition at line 51 of file RemarkSerializer.h.

◆ metaSerializer()

virtual std::unique_ptr< MetaSerializer > llvm::remarks::RemarkSerializer::metaSerializer ( raw_ostream & OS,
StringRef ExternalFilename )
pure virtual

Return the corresponding metadata serializer.

Implemented in llvm::remarks::BitstreamRemarkSerializer, and llvm::remarks::YAMLRemarkSerializer.

References OS.

Referenced by llvm::AsmPrinter::emitRemarksSection().

Member Data Documentation

◆ OS

◆ SerializerFormat

Format llvm::remarks::RemarkSerializer::SerializerFormat

◆ StrTab

std::optional<StringTable> llvm::remarks::RemarkSerializer::StrTab

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