LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::remarks::Argument Struct Reference

A key-value pair with a debug location that is used to display the remarks at the right place in the source. More...

#include "llvm/Remarks/Remark.h"

Public Member Functions

void print (raw_ostream &OS) const
 Implement operator<< on Argument.
 
std::optional< int > getValAsInt () const
 Return the value of argument as int.
 
bool isValInt () const
 Check if the argument value can be parsed as int.
 

Public Attributes

StringRef Key
 
StringRef Val
 
std::optional< RemarkLocationLoc
 

Detailed Description

A key-value pair with a debug location that is used to display the remarks at the right place in the source.

Definition at line 46 of file Remark.h.

Member Function Documentation

◆ getValAsInt()

std::optional< int > Argument::getValAsInt ( ) const

Return the value of argument as int.

Returns the value of a specified key parsed from StringRef.

Definition at line 30 of file Remark.cpp.

References llvm::StringRef::getAsInteger(), llvm::APInt::getSExtValue(), and Val.

Referenced by isValInt().

◆ isValInt()

bool Argument::isValInt ( ) const

Check if the argument value can be parsed as int.

Definition at line 37 of file Remark.cpp.

References getValAsInt().

◆ print()

void Argument::print ( raw_ostream OS) const

Implement operator<< on Argument.

Definition at line 45 of file Remark.cpp.

References Key, OS, and Val.

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

Member Data Documentation

◆ Key

StringRef llvm::remarks::Argument::Key

◆ Loc

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

◆ Val

StringRef llvm::remarks::Argument::Val

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