LLVM 22.0.0git
llvm::InstrProfError Class Reference

#include "llvm/ProfileData/InstrProf.h"

Inheritance diagram for llvm::InstrProfError:
[legend]

Public Member Functions

 InstrProfError (instrprof_error Err, const Twine &ErrStr=Twine())
std::string message () const override
 Return the error message as a string.
void log (raw_ostream &OS) const override
 Print an error message to an output stream.
std::error_code convertToErrorCode () const override
 Convert this error to a std::error_code.
instrprof_error get () const
const std::string & getMessage () const
Public Member Functions inherited from llvm::ErrorInfo< InstrProfError >
const void * dynamicClassID () const override
bool isA (const void *const ClassID) const override
Public Member Functions inherited from llvm::ErrorInfoBase
virtual ~ErrorInfoBase ()=default
template<typename ErrorInfoT>
bool isA () const

Static Public Member Functions

static std::pair< instrprof_error, std::string > take (Error E)
 Consume an Error and return the raw enum value contained within it, and the optional error message.
Static Public Member Functions inherited from llvm::ErrorInfo< InstrProfError >
static const void * classID ()
Static Public Member Functions inherited from llvm::ErrorInfoBase
static const void * classID ()

Static Public Attributes

static char ID = 0

Detailed Description

Definition at line 450 of file InstrProf.h.

Constructor & Destructor Documentation

◆ InstrProfError()

llvm::InstrProfError::InstrProfError ( instrprof_error Err,
const Twine & ErrStr = Twine() )
inline

Definition at line 452 of file InstrProf.h.

References assert(), and llvm::success.

Referenced by take().

Member Function Documentation

◆ convertToErrorCode()

std::error_code llvm::InstrProfError::convertToErrorCode ( ) const
inlineoverridevirtual

Convert this error to a std::error_code.

This is a temporary crutch to enable interaction with code still using std::error_code. It will be removed in the future.

Implements llvm::ErrorInfoBase.

Definition at line 461 of file InstrProf.h.

References llvm::make_error_code().

◆ get()

instrprof_error llvm::InstrProfError::get ( ) const
inline

Definition at line 465 of file InstrProf.h.

Referenced by llvm::InstrProfReader::error(), readMemprof(), and take().

◆ getMessage()

const std::string & llvm::InstrProfError::getMessage ( ) const
inline

Definition at line 466 of file InstrProf.h.

Referenced by llvm::InstrProfReader::error(), and take().

◆ log()

void llvm::InstrProfError::log ( raw_ostream & OS) const
inlineoverridevirtual

Print an error message to an output stream.

Implements llvm::ErrorInfoBase.

Definition at line 459 of file InstrProf.h.

References message().

◆ message()

std::string llvm::InstrProfError::message ( ) const
overridevirtual

Return the error message as a string.

Reimplemented from llvm::ErrorInfoBase.

Definition at line 257 of file InstrProf.cpp.

References getInstrProfErrString().

Referenced by log(), and readMemprof().

◆ take()

std::pair< instrprof_error, std::string > llvm::InstrProfError::take ( Error E)
inlinestatic

Consume an Error and return the raw enum value contained within it, and the optional error message.

The Error must either be a success value, or contain a single InstrProfError.

Definition at line 471 of file InstrProf.h.

References assert(), E(), get(), getMessage(), llvm::handleAllErrors(), InstrProfError(), and llvm::success.

Referenced by llvm::IndexedInstrProfReader::getSymtab().

Member Data Documentation

◆ ID

char llvm::InstrProfError::ID = 0
static

Definition at line 482 of file InstrProf.h.


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