summaryrefslogtreecommitdiff
path: root/include/llvm/Support/ErrorHandling.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-10 03:36:26 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-10 03:36:26 +0000
commitca15f3d6d6c29e9cc75225730270e9ef85834a22 (patch)
tree5015e53ccf1168f6c7b52c3499381d7dc4c7099b /include/llvm/Support/ErrorHandling.h
parent64a6b3941759587d5d1800580e959a2d40e7f17c (diff)
downloadllvm-ca15f3d6d6c29e9cc75225730270e9ef85834a22.tar.gz
llvm-ca15f3d6d6c29e9cc75225730270e9ef85834a22.tar.bz2
llvm-ca15f3d6d6c29e9cc75225730270e9ef85834a22.tar.xz
Add support for a user supplied pointer argument to llvm_install_error_handler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/ErrorHandling.h')
-rw-r--r--include/llvm/Support/ErrorHandling.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/include/llvm/Support/ErrorHandling.h b/include/llvm/Support/ErrorHandling.h
index 94541b52f7..dccdf9b29c 100644
--- a/include/llvm/Support/ErrorHandling.h
+++ b/include/llvm/Support/ErrorHandling.h
@@ -22,19 +22,25 @@ namespace llvm {
class Twine;
/// An error handler callback.
- typedef void (*llvm_error_handler_t)(const std::string& reason);
+ typedef void (*llvm_error_handler_t)(void *user_data,
+ const std::string& reason);
- /// Installs a new error handler: this function will be called whenever a
- /// serious error is encountered by LLVM.
+ /// llvm_instal_error_handler - Installs a new error handler to be used
+ /// whenever a serious (non-recoverable) error is encountered by LLVM.
+ ///
/// If you are using llvm_start_multithreaded, you should register the handler
/// before doing that.
///
/// If no error handler is installed the default is to print the error message
- /// to stderr, and call exit(1).
- /// If an error handler is installed then it is the handler's responsibility
- /// to log the message, it will no longer be printed to stderr.
- /// If the error handler returns, then exit(1) will be called.
- void llvm_install_error_handler(llvm_error_handler_t handler);
+ /// to stderr, and call exit(1). If an error handler is installed then it is
+ /// the handler's responsibility to log the message, it will no longer be
+ /// printed to stderr. If the error handler returns, then exit(1) will be
+ /// called.
+ ///
+ /// \param user_data - An argument which will be passed to the install error
+ /// handler.
+ void llvm_install_error_handler(llvm_error_handler_t handler,
+ void *user_data = 0);
/// Restores default error handling behaviour.
/// This must not be called between llvm_start_multithreaded() and