LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
llvm::CGDataError Class Reference

#include "llvm/CGData/CodeGenData.h"

Inheritance diagram for llvm::CGDataError:
Inheritance graph
[legend]

Public Member Functions

 CGDataError (cgdata_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.
 
cgdata_error get () const
 
const std::string & getMessage () const
 
- Public Member Functions inherited from llvm::ErrorInfo< CGDataError >
const void * dynamicClassID () const override
 
bool isA (const void *const ClassID) const override
 
- Public Member Functions inherited from llvm::ErrorInfoBase
virtual ~ErrorInfoBase ()=default
 
virtual void log (raw_ostream &OS) const =0
 Print an error message to an output stream.
 
virtual std::string message () const
 Return the error message as a string.
 
virtual std::error_code convertToErrorCode () const =0
 Convert this error to a std::error_code.
 
virtual const void * dynamicClassID () const =0
 
virtual bool isA (const void *const ClassID) const
 
template<typename ErrorInfoT >
bool isA () const
 

Static Public Member Functions

static std::pair< cgdata_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< CGDataError >
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 66 of file CodeGenData.h.

Constructor & Destructor Documentation

◆ CGDataError()

llvm::CGDataError::CGDataError ( cgdata_error  Err,
const Twine ErrStr = Twine() 
)
inline

Definition at line 68 of file CodeGenData.h.

References assert(), and llvm::success.

Member Function Documentation

◆ convertToErrorCode()

std::error_code llvm::CGDataError::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 77 of file CodeGenData.h.

References llvm::make_error_code().

◆ get()

cgdata_error llvm::CGDataError::get ( ) const
inline

Definition at line 81 of file CodeGenData.h.

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

◆ getMessage()

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

Definition at line 82 of file CodeGenData.h.

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

◆ log()

void llvm::CGDataError::log ( raw_ostream OS) const
inlineoverridevirtual

Print an error message to an output stream.

Implements llvm::ErrorInfoBase.

Definition at line 75 of file CodeGenData.h.

References message(), and OS.

◆ message()

std::string CGDataError::message ( ) const
overridevirtual

Return the error message as a string.

Reimplemented from llvm::ErrorInfoBase.

Definition at line 98 of file CodeGenData.cpp.

References getCGDataErrString().

Referenced by log(), and llvm::cgdata::warn().

◆ take()

static std::pair< cgdata_error, std::string > llvm::CGDataError::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 CGDataError.

Definition at line 87 of file CodeGenData.h.

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

Member Data Documentation

◆ ID

char CGDataError::ID = 0
static

Definition at line 98 of file CodeGenData.h.


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