1 /*===-- llvm-c/ErrorHandling.h - Error Handling C Interface -------*- C -*-===*\
3 |* The LLVM Compiler Infrastructure *|
5 |* This file is distributed under the University of Illinois Open Source *|
6 |* License. See LICENSE.TXT for details. *|
8 |*===----------------------------------------------------------------------===*|
10 |* This file defines the C interface to LLVM's error handling mechanism. *|
12 \*===----------------------------------------------------------------------===*/
14 #ifndef LLVM_C_ERROR_HANDLING_H
15 #define LLVM_C_ERROR_HANDLING_H
17 #include "llvm-c/Types.h"
23 typedef void (*LLVMFatalErrorHandler)(const char *Reason);
26 * Install a fatal error handler. By default, if LLVM detects a fatal error, it
27 * will call exit(1). This may not be appropriate in many contexts. For example,
28 * doing exit(1) will bypass many crash reporting/tracing system tools. This
29 * function allows you to install a callback that will be invoked prior to the
32 void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler);
35 * Reset the fatal error handler. This resets LLVM's fatal error handling
36 * behavior to the default.
38 void LLVMResetFatalErrorHandler(void);
41 * Enable LLVM's built-in stack trace code. This intercepts the OS's crash
42 * signals and prints which component of LLVM you were in at the time if the
45 void LLVMEnablePrettyStackTrace(void);