LLVM  15.0.0git
Macros | Typedefs | Functions | Variables
Collaboration diagram for Error Handling:

Macros

#define LLVMErrorSuccess   0
 

Typedefs

typedef struct LLVMOpaqueError * LLVMErrorRef
 Opaque reference to an error instance. More...
 
typedef void(* LLVMFatalErrorHandler) (const char *Reason)
 

Functions

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 (void)
 Returns the type id for llvm StringError. More...
 
LLVMErrorRef LLVMCreateStringError (const char *ErrMsg)
 Create a StringError. More...
 
void LLVMInstallFatalErrorHandler (LLVMFatalErrorHandler Handler)
 Install a fatal error handler. More...
 
void LLVMResetFatalErrorHandler (void)
 Reset the fatal error handler. More...
 
void LLVMEnablePrettyStackTrace (void)
 Enable LLVM's built-in stack trace code. More...
 

Variables

const typedef void * LLVMErrorTypeId
 Error type identifier. More...
 

Detailed Description

Macro Definition Documentation

◆ LLVMErrorSuccess

#define LLVMErrorSuccess   0

Definition at line 28 of file Error.h.

Typedef Documentation

◆ LLVMErrorRef

typedef struct LLVMOpaqueError* LLVMErrorRef

Opaque reference to an error instance.

Null serves as the 'success' value.

Definition at line 33 of file Error.h.

◆ LLVMFatalErrorHandler

typedef void(* LLVMFatalErrorHandler) (const char *Reason)

Definition at line 27 of file ErrorHandling.h.

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 159 of file Error.cpp.

◆ LLVMCreateStringError()

LLVMErrorRef LLVMCreateStringError ( const char *  ErrMsg)

Create a StringError.

Definition at line 175 of file Error.cpp.

◆ LLVMDisposeErrorMessage()

void LLVMDisposeErrorMessage ( char *  ErrMsg)

Dispose of the given error message.

Definition at line 169 of file Error.cpp.

◆ LLVMEnablePrettyStackTrace()

void LLVMEnablePrettyStackTrace ( void  )

Enable LLVM's built-in stack trace code.

This intercepts the OS's crash signals and prints which component of LLVM you were in at the time if the crash.

Definition at line 325 of file PrettyStackTrace.cpp.

References llvm::EnablePrettyStackTrace().

◆ 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 161 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 155 of file Error.cpp.

◆ LLVMGetStringErrorTypeId()

LLVMErrorTypeId LLVMGetStringErrorTypeId ( void  )

Returns the type id for llvm StringError.

Definition at line 171 of file Error.cpp.

◆ LLVMInstallFatalErrorHandler()

void LLVMInstallFatalErrorHandler ( LLVMFatalErrorHandler  Handler)

Install a fatal error handler.

By default, if LLVM detects a fatal error, it will call exit(1). This may not be appropriate in many contexts. For example, doing exit(1) will bypass many crash reporting/tracing system tools. This function allows you to install a callback that will be invoked prior to the call to exit(1).

Definition at line 227 of file ErrorHandling.cpp.

References bindingsErrorHandler(), llvm::install_fatal_error_handler(), and LLVM_EXTENSION.

◆ LLVMResetFatalErrorHandler()

void LLVMResetFatalErrorHandler ( void  )

Reset the fatal error handler.

This resets LLVM's fatal error handling behavior to the default.

Definition at line 232 of file ErrorHandling.cpp.

References llvm::remove_fatal_error_handler().

Variable Documentation

◆ LLVMErrorTypeId

const typedef void* LLVMErrorTypeId

Error type identifier.

Definition at line 38 of file Error.h.