LLVM: Error Handling (original) (raw)
| Macros | |
|---|---|
| #define | LLVMErrorSuccess 0 |
| Typedefs | |
|---|---|
| typedef struct LLVMOpaqueError * | LLVMErrorRef |
| Opaque reference to an error instance. | |
| typedef const void * | LLVMErrorTypeId |
| Error type identifier. | |
| typedef void(* | LLVMFatalErrorHandler) (const char *Reason) |
| Functions | |
|---|---|
| LLVM_C_ABI LLVMErrorTypeId | LLVMGetErrorTypeId (LLVMErrorRef Err) |
| Returns the type id for the given error instance, which must be a failure value (i.e. | |
| LLVM_C_ABI void | LLVMConsumeError (LLVMErrorRef Err) |
| Dispose of the given error without handling it. | |
| LLVM_C_ABI void | LLVMCantFail (LLVMErrorRef Err) |
| Report a fatal error if Err is a failure value. | |
| LLVM_C_ABI char * | LLVMGetErrorMessage (LLVMErrorRef Err) |
| Returns the given string's error message. | |
| LLVM_C_ABI void | LLVMDisposeErrorMessage (char *ErrMsg) |
| Dispose of the given error message. | |
| LLVM_C_ABI LLVMErrorTypeId | LLVMGetStringErrorTypeId (void) |
| Returns the type id for llvm StringError. | |
| LLVM_C_ABI LLVMErrorRef | LLVMCreateStringError (const char *ErrMsg) |
| Create a StringError. | |
| LLVM_C_ABI void | LLVMInstallFatalErrorHandler (LLVMFatalErrorHandler Handler) |
| Install a fatal error handler. | |
| LLVM_C_ABI void | LLVMResetFatalErrorHandler (void) |
| Reset the fatal error handler. | |
| LLVM_C_ABI void | LLVMEnablePrettyStackTrace (void) |
| Enable LLVM's built-in stack trace code. |
◆ LLVMErrorSuccess
#define LLVMErrorSuccess 0
Definition at line 29 of file Error.h.
Referenced by LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(), LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(), LLVMOrcCreateLLJIT(), LLVMOrcCreateLocalLazyCallThroughManager(), LLVMOrcCreateObjectLinkingLayerWithInProcessMemoryManager(), LLVMOrcCreateStaticLibrarySearchGeneratorForPath(), LLVMOrcDisposeLLJIT(), LLVMOrcDumpObjects_CallOperator(), LLVMOrcExecutionSessionCreateJITDylib(), LLVMOrcExecutionSessionLookup(), LLVMOrcJITDylibDefine(), LLVMOrcJITTargetMachineBuilderDetectHost(), LLVMOrcLLJITLookup(), and LLVMOrcMaterializationResponsibilityDelegate().
◆ LLVMErrorRef
typedef struct LLVMOpaqueError* LLVMErrorRef
Opaque reference to an error instance.
Null serves as the 'success' value.
Definition at line 34 of file Error.h.
◆ LLVMErrorTypeId
Error type identifier.
Definition at line 39 of file Error.h.
◆ LLVMFatalErrorHandler
typedef void(* LLVMFatalErrorHandler) (const char *Reason)
◆ LLVMCantFail()
Report a fatal error if Err is a failure value.
This function can be used to wrap calls to fallible functions ONLY when it is known that the Error will always be a success value.
Definition at line 194 of file Error.cpp.
◆ LLVMConsumeError()
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 190 of file Error.cpp.
◆ LLVMCreateStringError()
Create a StringError.
Definition at line 212 of file Error.cpp.
◆ LLVMDisposeErrorMessage()
Dispose of the given error message.
Definition at line 206 of file Error.cpp.
◆ LLVMEnablePrettyStackTrace()
| LLVM_C_ABI void LLVMEnablePrettyStackTrace | ( | void | ) |
|---|
◆ LLVMGetErrorMessage()
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 198 of file Error.cpp.
◆ LLVMGetErrorTypeId()
Returns the type id for the given error instance, which must be a failure value (i.e.
non-null).
Definition at line 186 of file Error.cpp.
◆ LLVMGetStringErrorTypeId()
Returns the type id for llvm StringError.
Definition at line 208 of file Error.cpp.
◆ LLVMInstallFatalErrorHandler()
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 259 of file ErrorHandling.cpp.
References bindingsErrorHandler(), llvm::install_fatal_error_handler(), and LLVM_EXTENSION.
◆ LLVMResetFatalErrorHandler()
| LLVM_C_ABI void LLVMResetFatalErrorHandler | ( | void | ) |
|---|