LLVM  13.0.0git
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
llvm::ErrorReported Class Referencefinal

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

#include "FileCheck/FileCheckImpl.h"

Inheritance diagram for llvm::ErrorReported:
Inheritance graph
[legend]
Collaboration diagram for llvm::ErrorReported:
Collaboration graph
[legend]

Public Member Functions

std::error_code convertToErrorCode () const override
 Convert this error to a std::error_code. More...
 
void log (raw_ostream &OS) const override
 Print diagnostic associated with this error when printing the error. More...
 
- 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. More...
 
virtual const void * dynamicClassID () const =0
 
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 594 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 598 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 603 of file FileCheckImpl.h.

◆ reportedOrSuccess()

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

Definition at line 607 of file FileCheckImpl.h.

References llvm::Error::success().

Member Data Documentation

◆ ID

char ErrorReported::ID = 0
static

Definition at line 596 of file FileCheckImpl.h.


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