LLVM 22.0.0git
llvm::remarks::Remark Struct Reference

A remark type used for both emission and parsing. More...

#include "llvm/Remarks/Remark.h"

Public Member Functions

 Remark ()=default
 Remark (Remark &&)=default
Remarkoperator= (Remark &&)=default
LLVM_ABI std::string getArgsAsMsg () const
 Return a message composed from the arguments as a string.
Remark clone () const
 Clone this remark to explicitly ask for a copy.
LLVM_ABI void print (raw_ostream &OS) const
 Implement operator<< on Remark.

Public Attributes

Type RemarkType = Type::Unknown
 The type of the remark.
StringRef PassName
 Name of the pass that triggers the emission of this remark.
StringRef RemarkName
 Textual identifier for the remark (single-word, camel-case).
StringRef FunctionName
 Mangled name of the function that triggers the emssion of this remark.
std::optional< RemarkLocationLoc
 The location in the source file of the remark.
std::optional< uint64_tHotness
 If profile information is available, this is the number of times the corresponding code was executed in a profile instrumentation run.
SmallVector< Argument, 5 > Args
 Arguments collected via the streaming interface.

Detailed Description

A remark type used for both emission and parsing.

Definition at line 98 of file Remark.h.

Constructor & Destructor Documentation

◆ Remark() [1/2]

llvm::remarks::Remark::Remark ( )
default

Referenced by clone(), operator=(), and Remark().

◆ Remark() [2/2]

llvm::remarks::Remark::Remark ( Remark && )
default

References Remark().

Member Function Documentation

◆ clone()

Remark llvm::remarks::Remark::clone ( ) const
inline

Clone this remark to explicitly ask for a copy.

Definition at line 131 of file Remark.h.

References Remark().

◆ getArgsAsMsg()

std::string Remark::getArgsAsMsg ( ) const

Return a message composed from the arguments as a string.

Definition at line 21 of file Remark.cpp.

References Args.

◆ operator=()

Remark & llvm::remarks::Remark::operator= ( Remark && )
default

References LLVM_ABI, and Remark().

◆ print()

void Remark::print ( raw_ostream & OS) const

Implement operator<< on Remark.

Definition at line 49 of file Remark.cpp.

References Args, FunctionName, Hotness, Loc, PassName, RemarkName, RemarkType, and llvm::remarks::typeToStr().

Referenced by llvm::remarks::operator<<().

Member Data Documentation

◆ Args

SmallVector<Argument, 5> llvm::remarks::Remark::Args

Arguments collected via the streaming interface.

Definition at line 121 of file Remark.h.

Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), getArgsAsMsg(), llvm::remarks::YAMLRemarkParser::parseRemark(), and print().

◆ FunctionName

StringRef llvm::remarks::Remark::FunctionName

Mangled name of the function that triggers the emssion of this remark.

Definition at line 111 of file Remark.h.

Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), llvm::remarks::YAMLRemarkParser::parseRemark(), and print().

◆ Hotness

std::optional<uint64_t> llvm::remarks::Remark::Hotness

If profile information is available, this is the number of times the corresponding code was executed in a profile instrumentation run.

Definition at line 118 of file Remark.h.

Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), llvm::remarks::YAMLRemarkParser::parseRemark(), and print().

◆ Loc

std::optional<RemarkLocation> llvm::remarks::Remark::Loc

The location in the source file of the remark.

Definition at line 114 of file Remark.h.

Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), llvm::remarks::YAMLRemarkParser::parseRemark(), and print().

◆ PassName

StringRef llvm::remarks::Remark::PassName

Name of the pass that triggers the emission of this remark.

Definition at line 103 of file Remark.h.

Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), llvm::remarks::YAMLRemarkParser::parseRemark(), and print().

◆ RemarkName

StringRef llvm::remarks::Remark::RemarkName

Textual identifier for the remark (single-word, camel-case).

Can be used by external tools reading the output file for remarks to identify the remark.

Definition at line 108 of file Remark.h.

Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), llvm::remarks::YAMLRemarkParser::parseRemark(), and print().

◆ RemarkType

Type llvm::remarks::Remark::RemarkType = Type::Unknown

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