LLVM  10.0.0svn
Classes | Enumerations | Functions | Variables
llvm::remarks Namespace Reference

Classes

struct  Argument
 A key-value pair with a debug location that is used to display the remarks at the right place in the source. More...
 
struct  BitstreamMetaSerializer
 Serializer of metadata for bitstream remarks. More...
 
struct  BitstreamRemarkSerializer
 Implementation of the remark serializer using LLVM bitstream. More...
 
struct  BitstreamRemarkSerializerHelper
 Serialize the remarks to LLVM bitstream. More...
 
class  EndOfFileError
 
struct  MetaSerializer
 This is the base class for a remark metadata serializer. More...
 
struct  ParsedStringTable
 In-memory representation of the string table parsed from a buffer (e.g. More...
 
struct  Remark
 A remark type used for both emission and parsing. More...
 
struct  RemarkLocation
 The debug location used to track a remark back to the source file. More...
 
struct  RemarkParser
 Parser used to parse a raw buffer to remarks::Remark objects. More...
 
struct  RemarkSerializer
 This is the base class for a remark serializer. More...
 
struct  StringTable
 The string table used for serializing remarks. More...
 
struct  YAMLMetaSerializer
 
class  YAMLParseError
 
struct  YAMLRemarkParser
 Regular YAML to Remark parser. More...
 
struct  YAMLRemarkSerializer
 Serialize the remarks to YAML. More...
 
struct  YAMLStrTabMetaSerializer
 
struct  YAMLStrTabRemarkParser
 YAML with a string table to Remark parser. More...
 
struct  YAMLStrTabRemarkSerializer
 Serialize the remarks to YAML using a string table. More...
 

Enumerations

enum  BitstreamRemarkContainerType {
  BitstreamRemarkContainerType::SeparateRemarksMeta, BitstreamRemarkContainerType::SeparateRemarksFile, BitstreamRemarkContainerType::Standalone, BitstreamRemarkContainerType::First = SeparateRemarksMeta,
  BitstreamRemarkContainerType::Last = Standalone
}
 Type of the remark container. More...
 
enum  BlockIDs { META_BLOCK_ID = bitc::FIRST_APPLICATION_BLOCKID, REMARK_BLOCK_ID }
 The possible blocks that will be encountered in a bitstream remark container. More...
 
enum  RecordIDs {
  RECORD_META_CONTAINER_INFO = 1, RECORD_META_REMARK_VERSION, RECORD_META_STRTAB, RECORD_META_EXTERNAL_FILE,
  RECORD_REMARK_HEADER, RECORD_REMARK_DEBUG_LOC, RECORD_REMARK_HOTNESS, RECORD_REMARK_ARG_WITH_DEBUGLOC,
  RECORD_REMARK_ARG_WITHOUT_DEBUGLOC, RECORD_FIRST = RECORD_META_CONTAINER_INFO, RECORD_LAST = RECORD_REMARK_ARG_WITHOUT_DEBUGLOC
}
 The possible records that can be encountered in the previously described blocks. More...
 
enum  Type {
  Type::Unknown, Type::Passed, Type::Missed, Type::Analysis,
  Type::AnalysisFPCommute, Type::AnalysisAliasing, Type::Failure, Type::First = Unknown,
  Type::Last = Failure
}
 The type of the remark. More...
 
enum  Format { Format::Unknown, Format::YAML, Format::YAMLStrTab, Format::Bitstream }
 The format used for serializing/deserializing remarks. More...
 
enum  SerializerMode { SerializerMode::Separate, SerializerMode::Standalone }
 

Functions

constexpr StringRef ContainerMagic ("RMRK", 4)
 The magic number used for identifying remark blocks. More...
 
constexpr StringRef Magic ("REMARKS", 7)
 
Expected< FormatparseFormat (StringRef FormatStr)
 Parse and validate a string for the remark format. More...
 
Expected< std::unique_ptr< RemarkParser > > createRemarkParser (Format ParserFormat, StringRef Buf)
 
Expected< std::unique_ptr< RemarkParser > > createRemarkParser (Format ParserFormat, StringRef Buf, ParsedStringTable StrTab)
 
Expected< std::unique_ptr< RemarkParser > > createRemarkParserFromMeta (Format ParserFormat, StringRef Buf, Optional< ParsedStringTable > StrTab=None)
 
Expected< std::unique_ptr< RemarkSerializer > > createRemarkSerializer (Format RemarksFormat, SerializerMode Mode, raw_ostream &OS)
 Create a remark serializer. More...
 
Expected< std::unique_ptr< RemarkSerializer > > createRemarkSerializer (Format RemarksFormat, SerializerMode Mode, raw_ostream &OS, remarks::StringTable StrTab)
 Create a remark serializer that uses a pre-filled string table. More...
 
Expected< std::unique_ptr< YAMLRemarkParser > > createYAMLParserFromMeta (StringRef Buf, Optional< ParsedStringTable > StrTab=None)
 

Variables

constexpr uint64_t CurrentContainerVersion = 0
 The current version of the remark container. More...
 
constexpr StringRef MetaBlockName = StringRef("Meta", 4)
 
constexpr StringRef RemarkBlockName = StringRef("Remark", 6)
 
constexpr StringRef MetaContainerInfoName = StringRef("Container info", 14)
 
constexpr StringRef MetaRemarkVersionName = StringRef("Remark version", 14)
 
constexpr StringRef MetaStrTabName = StringRef("String table", 12)
 
constexpr StringRef MetaExternalFileName = StringRef("External File", 13)
 
constexpr StringRef RemarkHeaderName = StringRef("Remark header", 13)
 
constexpr StringRef RemarkDebugLocName = StringRef("Remark debug location", 21)
 
constexpr StringRef RemarkHotnessName = StringRef("Remark hotness", 14)
 
constexpr StringRef RemarkArgWithDebugLocName
 
constexpr StringRef RemarkArgWithoutDebugLocName = StringRef("Argument", 8)
 
constexpr uint64_t CurrentRemarkVersion = 0
 The current version of the remark entry. More...
 

Enumeration Type Documentation

◆ BitstreamRemarkContainerType

Type of the remark container.

The remark container has two modes:

  • separate: the metadata is separate from the remarks and points to the auxiliary file that contains the remarks.
  • standalone: the metadata and the remarks are emitted together.
Enumerator
SeparateRemarksMeta 

The metadata emitted separately.

This will contain the following:

  • Container version and type
  • String table
  • External file
SeparateRemarksFile 

The remarks emitted separately.

This will contain the following:

  • Container version and type
  • Remark version
Standalone 

Everything is emitted together.

This will contain the following:

  • Container version and type
  • Remark version
  • String table
First 
Last 

Definition at line 35 of file BitstreamRemarkContainer.h.

◆ BlockIDs

The possible blocks that will be encountered in a bitstream remark container.

Enumerator
META_BLOCK_ID 

The metadata block is mandatory.

It should always come after the BLOCKINFO_BLOCK, and contains metadata that should be used when parsing REMARK_BLOCKs. There should always be only one META_BLOCK.

REMARK_BLOCK_ID 

One remark entry is represented using a REMARK_BLOCK.

There can be multiple REMARK_BLOCKs in the same file.

Definition at line 59 of file BitstreamRemarkContainer.h.

◆ Format

enum llvm::remarks::Format
strong

The format used for serializing/deserializing remarks.

Enumerator
Unknown 
YAML 
YAMLStrTab 
Bitstream 

Definition at line 25 of file RemarkFormat.h.

◆ RecordIDs

The possible records that can be encountered in the previously described blocks.

Enumerator
RECORD_META_CONTAINER_INFO 
RECORD_META_REMARK_VERSION 
RECORD_META_STRTAB 
RECORD_META_EXTERNAL_FILE 
RECORD_REMARK_HEADER 
RECORD_REMARK_DEBUG_LOC 
RECORD_REMARK_HOTNESS 
RECORD_REMARK_ARG_WITH_DEBUGLOC 
RECORD_REMARK_ARG_WITHOUT_DEBUGLOC 
RECORD_FIRST 
RECORD_LAST 

Definition at line 75 of file BitstreamRemarkContainer.h.

◆ SerializerMode

Enumerator
Separate 
Standalone 

Definition at line 24 of file RemarkSerializer.h.

◆ Type

enum llvm::remarks::Type
strong

The type of the remark.

Enumerator
Unknown 
Passed 
Missed 
Analysis 
AnalysisFPCommute 
AnalysisAliasing 
Failure 
First 
Last 

Definition at line 54 of file Remark.h.

Function Documentation

◆ ContainerMagic()

constexpr StringRef llvm::remarks::ContainerMagic ( "RMRK"  ,
 
)

The magic number used for identifying remark blocks.

Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::setupBlockInfo().

◆ createRemarkParser() [1/2]

Expected< std::unique_ptr< RemarkParser > > llvm::remarks::createRemarkParser ( Format  ParserFormat,
StringRef  Buf 
)

◆ createRemarkParser() [2/2]

Expected< std::unique_ptr< RemarkParser > > llvm::remarks::createRemarkParser ( Format  ParserFormat,
StringRef  Buf,
ParsedStringTable  StrTab 
)

◆ createRemarkParserFromMeta()

Expected< std::unique_ptr< RemarkParser > > llvm::remarks::createRemarkParserFromMeta ( Format  ParserFormat,
StringRef  Buf,
Optional< ParsedStringTable StrTab = None 
)

◆ createRemarkSerializer() [1/2]

Expected< std::unique_ptr< RemarkSerializer > > llvm::remarks::createRemarkSerializer ( Format  RemarksFormat,
SerializerMode  Mode,
raw_ostream OS 
)

◆ createRemarkSerializer() [2/2]

Expected< std::unique_ptr< RemarkSerializer > > llvm::remarks::createRemarkSerializer ( Format  RemarksFormat,
SerializerMode  Mode,
raw_ostream OS,
remarks::StringTable  StrTab 
)

Create a remark serializer that uses a pre-filled string table.

Definition at line 38 of file RemarkSerializer.cpp.

References Bitstream, llvm::createStringError(), llvm_unreachable, Mode, Unknown, YAML, and YAMLStrTab.

◆ createYAMLParserFromMeta()

Expected< std::unique_ptr< YAMLRemarkParser > > llvm::remarks::createYAMLParserFromMeta ( StringRef  Buf,
Optional< ParsedStringTable StrTab = None 
)

◆ Magic()

constexpr StringRef llvm::remarks::Magic ( "REMARKS"  ,
 
)

Referenced by emitMagic(), and parseMagic().

◆ parseFormat()

Expected< Format > llvm::remarks::parseFormat ( StringRef  FormatStr)

Variable Documentation

◆ CurrentContainerVersion

constexpr uint64_t llvm::remarks::CurrentContainerVersion = 0

The current version of the remark container.

Note: this is different from the version of the remark entry.

Definition at line 26 of file BitstreamRemarkContainer.h.

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

◆ CurrentRemarkVersion

constexpr uint64_t llvm::remarks::CurrentRemarkVersion = 0

The current version of the remark entry.

Definition at line 27 of file Remark.h.

Referenced by llvm::remarks::BitstreamMetaSerializer::emit(), emitVersion(), and parseVersion().

◆ MetaBlockName

constexpr StringRef llvm::remarks::MetaBlockName = StringRef("Meta", 4)

◆ MetaContainerInfoName

constexpr StringRef llvm::remarks::MetaContainerInfoName = StringRef("Container info", 14)

◆ MetaExternalFileName

constexpr StringRef llvm::remarks::MetaExternalFileName = StringRef("External File", 13)

◆ MetaRemarkVersionName

constexpr StringRef llvm::remarks::MetaRemarkVersionName = StringRef("Remark version", 14)

◆ MetaStrTabName

constexpr StringRef llvm::remarks::MetaStrTabName = StringRef("String table", 12)

◆ RemarkArgWithDebugLocName

constexpr StringRef llvm::remarks::RemarkArgWithDebugLocName
Initial value:
=
StringRef("Argument with debug location", 28)

Definition at line 99 of file BitstreamRemarkContainer.h.

Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::setupRemarkBlockInfo().

◆ RemarkArgWithoutDebugLocName

constexpr StringRef llvm::remarks::RemarkArgWithoutDebugLocName = StringRef("Argument", 8)

◆ RemarkBlockName

constexpr StringRef llvm::remarks::RemarkBlockName = StringRef("Remark", 6)

◆ RemarkDebugLocName

constexpr StringRef llvm::remarks::RemarkDebugLocName = StringRef("Remark debug location", 21)

◆ RemarkHeaderName

constexpr StringRef llvm::remarks::RemarkHeaderName = StringRef("Remark header", 13)

◆ RemarkHotnessName

constexpr StringRef llvm::remarks::RemarkHotnessName = StringRef("Remark hotness", 14)