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

Serialize the remarks to YAML. More...

#include "llvm/Remarks/YAMLRemarkSerializer.h"

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

Public Member Functions

 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)
 

Public Attributes

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.
 

Protected Member Functions

 YAMLRemarkSerializer (Format SerializerFormat, raw_ostream &OS, SerializerMode Mode, std::optional< StringTable > StrTab=std::nullopt)
 

Detailed Description

Serialize the remarks to YAML.

One remark entry looks like this: — !<TYPE> Pass: <PASSNAME> Name: <REMARKNAME> DebugLoc: { File: <SOURCEFILENAME>, Line: <SOURCELINE>, Column: <SOURCECOLUMN> } Function: <FUNCTIONNAME> Args:

DebugLoc: { File: <FILE>, Line: <LINE>, Column: <COL> } ...

Definition at line 34 of file YAMLRemarkSerializer.h.

Constructor & Destructor Documentation

◆ YAMLRemarkSerializer() [1/2]

YAMLRemarkSerializer::YAMLRemarkSerializer ( raw_ostream OS,
SerializerMode  Mode,
std::optional< StringTable StrTab = std::nullopt 
)

Definition at line 160 of file YAMLRemarkSerializer.cpp.

◆ YAMLRemarkSerializer() [2/2]

YAMLRemarkSerializer::YAMLRemarkSerializer ( Format  SerializerFormat,
raw_ostream OS,
SerializerMode  Mode,
std::optional< StringTable StrTab = std::nullopt 
)
protected

Definition at line 164 of file YAMLRemarkSerializer.cpp.

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

Member Function Documentation

◆ classof()

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

◆ emit()

void YAMLRemarkSerializer::emit ( const Remark Remark)
overridevirtual

Emit a remark to the stream.

Implements llvm::remarks::RemarkSerializer.

Reimplemented in llvm::remarks::YAMLStrTabRemarkSerializer.

Definition at line 172 of file YAMLRemarkSerializer.cpp.

References YAMLOutput.

Referenced by llvm::remarks::YAMLStrTabRemarkSerializer::emit().

◆ metaSerializer()

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

Return the corresponding metadata serializer.

Implements llvm::remarks::RemarkSerializer.

Reimplemented in llvm::remarks::YAMLStrTabRemarkSerializer.

Definition at line 179 of file YAMLRemarkSerializer.cpp.

References llvm::remarks::RemarkSerializer::OS.

Member Data Documentation

◆ YAMLOutput

yaml::Output llvm::remarks::YAMLRemarkSerializer::YAMLOutput

The YAML streamer.

Definition at line 36 of file YAMLRemarkSerializer.h.

Referenced by emit().


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