LLVM 20.0.0git
|
Implementation of the remark serializer using LLVM bitstream. More...
#include "llvm/Remarks/BitstreamRemarkSerializer.h"
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< MetaSerializer > | metaSerializer (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< MetaSerializer > | metaSerializer (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_ostream & | OS |
The open raw_ostream that the remark diagnostics are emitted to. | |
SerializerMode | Mode |
The serialization mode. | |
std::optional< StringTable > | StrTab |
The string table containing all the unique strings used in the output. | |
Implementation of the remark serializer using LLVM bitstream.
Definition at line 124 of file BitstreamRemarkSerializer.h.
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::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.
|
inlinestatic |
Definition at line 154 of file BitstreamRemarkSerializer.h.
References llvm::remarks::Bitstream, and llvm::remarks::RemarkSerializer::SerializerFormat.
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.
|
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.
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().
BitstreamRemarkSerializerHelper llvm::remarks::BitstreamRemarkSerializer::Helper |
The helper to emit bitstream.
Definition at line 135 of file BitstreamRemarkSerializer.h.
Referenced by emit(), and metaSerializer().