LLVM 20.0.0git
|
Parses and holds the state of the latest parsed remark. More...
#include "Remarks/BitstreamRemarkParser.h"
Public Member Functions | |
BitstreamRemarkParser (StringRef Buf) | |
Create a parser that expects to find a string table embedded in the stream. | |
BitstreamRemarkParser (StringRef Buf, ParsedStringTable StrTab) | |
Create a parser that uses a pre-parsed string table. | |
Expected< std::unique_ptr< Remark > > | next () override |
If no error occurs, this returns a valid Remark object. | |
Error | parseMeta () |
Parse and process the metadata of the buffer. | |
Expected< std::unique_ptr< Remark > > | parseRemark () |
Parse a Bitstream remark. | |
Public Member Functions inherited from llvm::remarks::RemarkParser | |
RemarkParser (Format ParserFormat) | |
virtual Expected< std::unique_ptr< Remark > > | next ()=0 |
If no error occurs, this returns a valid Remark object. | |
virtual | ~RemarkParser ()=default |
Static Public Member Functions | |
static bool | classof (const RemarkParser *P) |
Public Attributes | |
BitstreamParserHelper | ParserHelper |
The buffer to parse. | |
std::optional< ParsedStringTable > | StrTab |
The string table used for parsing strings. | |
std::unique_ptr< MemoryBuffer > | TmpRemarkBuffer |
Temporary remark buffer used when the remarks are stored separately. | |
uint64_t | ContainerVersion = 0 |
The common metadata used to decide how to parse the buffer. | |
uint64_t | RemarkVersion = 0 |
BitstreamRemarkContainerType | ContainerType |
bool | ReadyToParseRemarks = false |
Wether the parser is ready to parse remarks. | |
Public Attributes inherited from llvm::remarks::RemarkParser | |
Format | ParserFormat |
The format of the parser. | |
std::string | ExternalFilePrependPath |
Path to prepend when opening an external remark file. | |
Parses and holds the state of the latest parsed remark.
Definition at line 30 of file BitstreamRemarkParser.h.
|
inlineexplicit |
Create a parser that expects to find a string table embedded in the stream.
Definition at line 48 of file BitstreamRemarkParser.h.
|
inline |
Create a parser that uses a pre-parsed string table.
Definition at line 52 of file BitstreamRemarkParser.h.
|
inlinestatic |
Definition at line 58 of file BitstreamRemarkParser.h.
References llvm::remarks::Bitstream, and P.
If no error occurs, this returns a valid Remark object.
If an error of type EndOfFileError occurs, it is safe to recover from it by stopping the parsing. If any other error occurs, it should be propagated to the user. The pointer should never be null.
Implements llvm::remarks::RemarkParser.
Definition at line 332 of file BitstreamRemarkParser.cpp.
References llvm::remarks::BitstreamParserHelper::atEndOfStream(), parseMeta(), parseRemark(), ParserHelper, and ReadyToParseRemarks.
Error BitstreamRemarkParser::parseMeta | ( | ) |
Parse and process the metadata of the buffer.
Definition at line 345 of file BitstreamRemarkParser.cpp.
References advanceToMetaBlock(), llvm::remarks::BitstreamParserHelper::BlockInfo, ContainerType, llvm_unreachable, llvm::remarks::BitstreamMetaParserHelper::parse(), ParserHelper, llvm::remarks::SeparateRemarksFile, llvm::remarks::SeparateRemarksMeta, llvm::remarks::Standalone, and llvm::remarks::BitstreamParserHelper::Stream.
Referenced by next().
Parse a Bitstream remark.
Definition at line 492 of file BitstreamRemarkParser.cpp.
References llvm::remarks::BitstreamRemarkParserHelper::parse(), ParserHelper, and llvm::remarks::BitstreamParserHelper::Stream.
Referenced by next().
BitstreamRemarkContainerType llvm::remarks::BitstreamRemarkParser::ContainerType |
uint64_t llvm::remarks::BitstreamRemarkParser::ContainerVersion = 0 |
The common metadata used to decide how to parse the buffer.
This is filled when parsing the metadata block.
Definition at line 39 of file BitstreamRemarkParser.h.
BitstreamParserHelper llvm::remarks::BitstreamRemarkParser::ParserHelper |
The buffer to parse.
Definition at line 32 of file BitstreamRemarkParser.h.
Referenced by next(), parseMeta(), and parseRemark().
bool llvm::remarks::BitstreamRemarkParser::ReadyToParseRemarks = false |
Wether the parser is ready to parse remarks.
Definition at line 44 of file BitstreamRemarkParser.h.
Referenced by next().
uint64_t llvm::remarks::BitstreamRemarkParser::RemarkVersion = 0 |
Definition at line 40 of file BitstreamRemarkParser.h.
std::optional<ParsedStringTable> llvm::remarks::BitstreamRemarkParser::StrTab |
The string table used for parsing strings.
Definition at line 34 of file BitstreamRemarkParser.h.
std::unique_ptr<MemoryBuffer> llvm::remarks::BitstreamRemarkParser::TmpRemarkBuffer |
Temporary remark buffer used when the remarks are stored separately.
Definition at line 36 of file BitstreamRemarkParser.h.