Path: blob/main/contrib/llvm-project/llvm/include/llvm-c/ErrorHandling.h
35234 views
/*===-- llvm-c/ErrorHandling.h - Error Handling C Interface -------*- C -*-===*\1|* *|2|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|3|* Exceptions. *|4|* See https://llvm.org/LICENSE.txt for license information. *|5|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|6|* *|7|*===----------------------------------------------------------------------===*|8|* *|9|* This file defines the C interface to LLVM's error handling mechanism. *|10|* *|11\*===----------------------------------------------------------------------===*/1213#ifndef LLVM_C_ERRORHANDLING_H14#define LLVM_C_ERRORHANDLING_H1516#include "llvm-c/ExternC.h"1718LLVM_C_EXTERN_C_BEGIN1920/**21* @addtogroup LLVMCError22*23* @{24*/2526typedef void (*LLVMFatalErrorHandler)(const char *Reason);2728/**29* Install a fatal error handler. By default, if LLVM detects a fatal error, it30* will call exit(1). This may not be appropriate in many contexts. For example,31* doing exit(1) will bypass many crash reporting/tracing system tools. This32* function allows you to install a callback that will be invoked prior to the33* call to exit(1).34*/35void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler);3637/**38* Reset the fatal error handler. This resets LLVM's fatal error handling39* behavior to the default.40*/41void LLVMResetFatalErrorHandler(void);4243/**44* Enable LLVM's built-in stack trace code. This intercepts the OS's crash45* signals and prints which component of LLVM you were in at the time if the46* crash.47*/48void LLVMEnablePrettyStackTrace(void);4950/**51* @}52*/5354LLVM_C_EXTERN_C_END5556#endif575859