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

Serialize the remarks to YAML using a string table. More...

#include "llvm/Remarks/YAMLRemarkSerializer.h"

Inheritance diagram for llvm::remarks::YAMLStrTabRemarkSerializer:
Inheritance graph
[legend]

Public Member Functions

 YAMLStrTabRemarkSerializer (raw_ostream &OS, SerializerMode Mode)
 
 YAMLStrTabRemarkSerializer (raw_ostream &OS, SerializerMode Mode, StringTable StrTab)
 
void emit (const Remark &Remark) override
 Override to emit the metadata if necessary.
 
std::unique_ptr< MetaSerializermetaSerializer (raw_ostream &OS, std::optional< StringRef > ExternalFilename=std::nullopt) override
 Return the corresponding metadata serializer.
 
- Public Member Functions inherited from llvm::remarks::YAMLRemarkSerializer
 YAMLRemarkSerializer (raw_ostream &OS, SerializerMode Mode, std::optional< StringTable > StrTab=std::nullopt)
 
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
 Return the corresponding metadata 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)
 
- Static Public Member Functions inherited from llvm::remarks::YAMLRemarkSerializer
static bool classof (const RemarkSerializer *S)
 

Public Attributes

bool DidEmitMeta = false
 Wether we already emitted the metadata in standalone mode.
 
- Public Attributes inherited from llvm::remarks::YAMLRemarkSerializer
yaml::Output YAMLOutput
 The YAML streamer.
 
- 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.
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::remarks::YAMLRemarkSerializer
 YAMLRemarkSerializer (Format SerializerFormat, raw_ostream &OS, SerializerMode Mode, std::optional< StringTable > StrTab=std::nullopt)
 

Detailed Description

Serialize the remarks to YAML using a string table.

An remark entry looks like the regular YAML remark but instead of string entries it's using numbers that map to an index in the string table.

Definition at line 68 of file YAMLRemarkSerializer.h.

Constructor & Destructor Documentation

◆ YAMLStrTabRemarkSerializer() [1/2]

llvm::remarks::YAMLStrTabRemarkSerializer::YAMLStrTabRemarkSerializer ( raw_ostream OS,
SerializerMode  Mode 
)
inline

Definition at line 73 of file YAMLRemarkSerializer.h.

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

◆ YAMLStrTabRemarkSerializer() [2/2]

llvm::remarks::YAMLStrTabRemarkSerializer::YAMLStrTabRemarkSerializer ( raw_ostream OS,
SerializerMode  Mode,
StringTable  StrTab 
)
inline

Definition at line 78 of file YAMLRemarkSerializer.h.

Member Function Documentation

◆ classof()

static bool llvm::remarks::YAMLStrTabRemarkSerializer::classof ( const RemarkSerializer S)
inlinestatic

◆ emit()

void YAMLStrTabRemarkSerializer::emit ( const Remark Remark)
overridevirtual

◆ metaSerializer()

std::unique_ptr< MetaSerializer > YAMLStrTabRemarkSerializer::metaSerializer ( raw_ostream OS,
std::optional< StringRef ExternalFilename = std::nullopt 
)
overridevirtual

Return the corresponding metadata serializer.

Reimplemented from llvm::remarks::YAMLRemarkSerializer.

Definition at line 198 of file YAMLRemarkSerializer.cpp.

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

Referenced by emit().

Member Data Documentation

◆ DidEmitMeta

bool llvm::remarks::YAMLStrTabRemarkSerializer::DidEmitMeta = false

Wether we already emitted the metadata in standalone mode.

This should be set to true after the first invocation of emit.

Definition at line 71 of file YAMLRemarkSerializer.h.

Referenced by emit().


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