LLVM  13.0.0git
Namespaces | Functions | Variables
Error.cpp File Reference
#include "llvm/Support/Error.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
#include <system_error>
#include "llvm/Testing/Support/Error.h"
#include "llvm/ADT/StringRef.h"
Include dependency graph for Error.cpp:

Go to the source code of this file.

Namespaces

 llvm
 

Functions

void llvm::logAllUnhandledErrors (Error E, raw_ostream &OS, Twine ErrorBanner={})
 Log all errors (if any) in E to OS. More...
 
std::error_code llvm::inconvertibleErrorCode ()
 The value returned by this function can be returned from convertToErrorCode for Error values where no sensible translation to std::error_code exists. More...
 
Error llvm::errorCodeToError (std::error_code EC)
 Helper for converting an std::error_code to a Error. More...
 
std::error_code llvm::errorToErrorCode (Error Err)
 Helper for converting an ECError to a std::error_code. More...
 
Error llvm::createStringError (std::error_code EC, char const *Msg)
 
LLVM_ATTRIBUTE_NORETURN void llvm::report_fatal_error (Error Err, bool gen_crash_diag=true)
 Report a serious error, calling any installed error handler. More...
 
LLVMErrorTypeId LLVMGetErrorTypeId (LLVMErrorRef Err)
 Returns the type id for the given error instance, which must be a failure value (i.e. More...
 
void LLVMConsumeError (LLVMErrorRef Err)
 Dispose of the given error without handling it. More...
 
char * LLVMGetErrorMessage (LLVMErrorRef Err)
 Returns the given string's error message. More...
 
void LLVMDisposeErrorMessage (char *ErrMsg)
 Dispose of the given error message. More...
 
LLVMErrorTypeId LLVMGetStringErrorTypeId ()
 Returns the type id for llvm StringError. More...
 
LLVMErrorRef LLVMCreateStringError (const char *ErrMsg)
 Create a StringError. More...
 

Variables

static ManagedStatic< ErrorErrorCategory > ErrorErrorCat
 

Function Documentation

◆ LLVMConsumeError()

void LLVMConsumeError ( LLVMErrorRef  Err)

Dispose of the given error without handling it.

This operation consumes the error, and the given LLVMErrorRef value is not usable once this call returns. Note: This method only needs to be called if the error is not being passed to some other consuming operation, e.g. LLVMGetErrorMessage.

Definition at line 156 of file Error.cpp.

◆ LLVMCreateStringError()

LLVMErrorRef LLVMCreateStringError ( const char *  ErrMsg)

Create a StringError.

Definition at line 172 of file Error.cpp.

◆ LLVMDisposeErrorMessage()

void LLVMDisposeErrorMessage ( char *  ErrMsg)

Dispose of the given error message.

Definition at line 166 of file Error.cpp.

◆ LLVMGetErrorMessage()

char* LLVMGetErrorMessage ( LLVMErrorRef  Err)

Returns the given string's error message.

This operation consumes the error, and the given LLVMErrorRef value is not usable once this call returns. The caller is responsible for disposing of the string by calling LLVMDisposeErrorMessage.

Definition at line 158 of file Error.cpp.

◆ LLVMGetErrorTypeId()

LLVMErrorTypeId LLVMGetErrorTypeId ( LLVMErrorRef  Err)

Returns the type id for the given error instance, which must be a failure value (i.e.

non-null).

Definition at line 152 of file Error.cpp.

◆ LLVMGetStringErrorTypeId()

LLVMErrorTypeId LLVMGetStringErrorTypeId ( )

Returns the type id for llvm StringError.

Definition at line 168 of file Error.cpp.

Variable Documentation

◆ ErrorErrorCat

ManagedStatic<ErrorErrorCategory> ErrorErrorCat
static

Definition at line 49 of file Error.cpp.