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

Parses and holds the state of the latest parsed remark. More...

#include "Remarks/BitstreamRemarkParser.h"

Inheritance diagram for llvm::remarks::BitstreamRemarkParser:
Inheritance graph
[legend]
Collaboration diagram for llvm::remarks::BitstreamRemarkParser:
Collaboration graph
[legend]

Public Member Functions

 BitstreamRemarkParser (StringRef Buf)
 Create a parser that expects to find a string table embedded in the stream. More...
 
 BitstreamRemarkParser (StringRef Buf, ParsedStringTable StrTab)
 Create a parser that uses a pre-parsed string table. More...
 
Expected< std::unique_ptr< Remark > > next () override
 If no error occurs, this returns a valid Remark object. More...
 
Error parseMeta ()
 Parse and process the metadata of the buffer. More...
 
Expected< std::unique_ptr< Remark > > parseRemark ()
 Parse a Bitstream remark. More...
 
- Public Member Functions inherited from llvm::remarks::RemarkParser
 RemarkParser (Format ParserFormat)
 
virtual ~RemarkParser ()=default
 

Static Public Member Functions

static bool classof (const RemarkParser *P)
 

Public Attributes

BitstreamParserHelper ParserHelper
 The buffer to parse. More...
 
Optional< ParsedStringTableStrTab
 The string table used for parsing strings. More...
 
std::unique_ptr< MemoryBufferTmpRemarkBuffer
 Temporary remark buffer used when the remarks are stored separately. More...
 
uint64_t ContainerVersion = 0
 The common metadata used to decide how to parse the buffer. More...
 
uint64_t RemarkVersion = 0
 
BitstreamRemarkContainerType ContainerType
 
bool ReadyToParseRemarks = false
 Wether the parser is ready to parse remarks. More...
 
- Public Attributes inherited from llvm::remarks::RemarkParser
Format ParserFormat
 The format of the parser. More...
 
std::string ExternalFilePrependPath
 Path to prepend when opening an external remark file. More...
 

Detailed Description

Parses and holds the state of the latest parsed remark.

Definition at line 28 of file BitstreamRemarkParser.h.

Constructor & Destructor Documentation

◆ BitstreamRemarkParser() [1/2]

llvm::remarks::BitstreamRemarkParser::BitstreamRemarkParser ( StringRef  Buf)
inlineexplicit

Create a parser that expects to find a string table embedded in the stream.

Definition at line 46 of file BitstreamRemarkParser.h.

◆ BitstreamRemarkParser() [2/2]

llvm::remarks::BitstreamRemarkParser::BitstreamRemarkParser ( StringRef  Buf,
ParsedStringTable  StrTab 
)
inline

Create a parser that uses a pre-parsed string table.

Definition at line 50 of file BitstreamRemarkParser.h.

References next().

Member Function Documentation

◆ classof()

static bool llvm::remarks::BitstreamRemarkParser::classof ( const RemarkParser P)
inlinestatic

◆ next()

Expected< std::unique_ptr< Remark > > BitstreamRemarkParser::next ( )
overridevirtual

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 331 of file BitstreamRemarkParser.cpp.

References E.

Referenced by BitstreamRemarkParser().

◆ parseMeta()

Error BitstreamRemarkParser::parseMeta ( )

◆ parseRemark()

Expected< std::unique_ptr< Remark > > BitstreamRemarkParser::parseRemark ( )

Member Data Documentation

◆ ContainerType

BitstreamRemarkContainerType llvm::remarks::BitstreamRemarkParser::ContainerType
Initial value:

Definition at line 39 of file BitstreamRemarkParser.h.

◆ ContainerVersion

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 37 of file BitstreamRemarkParser.h.

◆ ParserHelper

BitstreamParserHelper llvm::remarks::BitstreamRemarkParser::ParserHelper

The buffer to parse.

Definition at line 30 of file BitstreamRemarkParser.h.

◆ ReadyToParseRemarks

bool llvm::remarks::BitstreamRemarkParser::ReadyToParseRemarks = false

Wether the parser is ready to parse remarks.

Definition at line 42 of file BitstreamRemarkParser.h.

◆ RemarkVersion

uint64_t llvm::remarks::BitstreamRemarkParser::RemarkVersion = 0

Definition at line 38 of file BitstreamRemarkParser.h.

Referenced by processRemarkVersion().

◆ StrTab

Optional<ParsedStringTable> llvm::remarks::BitstreamRemarkParser::StrTab

The string table used for parsing strings.

Definition at line 32 of file BitstreamRemarkParser.h.

Referenced by classof(), and processStrTab().

◆ TmpRemarkBuffer

std::unique_ptr<MemoryBuffer> llvm::remarks::BitstreamRemarkParser::TmpRemarkBuffer

Temporary remark buffer used when the remarks are stored separately.

Definition at line 34 of file BitstreamRemarkParser.h.


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