LLVM 22.0.0git
llvm::ErrorReported Class Referencefinal

An error that has already been reported. More...

#include "FileCheck/FileCheckImpl.h"

Inheritance diagram for llvm::ErrorReported:
[legend]

Public Member Functions

std::error_code convertToErrorCode () const override
 Convert this error to a std::error_code.
void log (raw_ostream &OS) const override
 Print diagnostic associated with this error when printing the error.
Public Member Functions inherited from llvm::ErrorInfo< ErrorReported >
const void * dynamicClassID () const override
bool isA (const void *const ClassID) const override
Public Member Functions inherited from llvm::ErrorInfoBase
virtual ~ErrorInfoBase ()=default
virtual std::string message () const
 Return the error message as a string.
template<typename ErrorInfoT>
bool isA () const

Static Public Member Functions

static Error reportedOrSuccess (bool HasErrorReported)
Static Public Member Functions inherited from llvm::ErrorInfo< ErrorReported >
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

An error that has already been reported.

This class is designed to support a function whose callers may need to know whether the function encountered and reported an error but never need to know the nature of that error. For example, the function has a return type of Error and always returns either ErrorReported or ErrorSuccess. That interface is similar to that of a function returning bool to indicate an error except, in the former case, (1) there is no confusion over polarity and (2) the caller must either check the result or explicitly ignore it with a call like consumeError.

Definition at line 567 of file FileCheckImpl.h.

Member Function Documentation

◆ convertToErrorCode()

std::error_code llvm::ErrorReported::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 571 of file FileCheckImpl.h.

References llvm::inconvertibleErrorCode().

◆ log()

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

Print diagnostic associated with this error when printing the error.

Implements llvm::ErrorInfoBase.

Definition at line 576 of file FileCheckImpl.h.

◆ reportedOrSuccess()

Error llvm::ErrorReported::reportedOrSuccess ( bool HasErrorReported)
inlinestatic

Definition at line 580 of file FileCheckImpl.h.

References llvm::make_error(), and llvm::Error::success().

Referenced by printMatch(), and printNoMatch().

Member Data Documentation

◆ ID

char ErrorReported::ID = 0
static

Definition at line 569 of file FileCheckImpl.h.


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