summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/ErrorHandling.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-03-16 01:02:46 +0000
committerLang Hames <lhames@gmail.com>2016-03-16 01:02:46 +0000
commitf7f6d3e93f739077dc280532d906ca523489b01f (patch)
tree7dd9cbb4fc2e18eec6a80d040b31ac0a9bbe15d2 /llvm/lib/Support/ErrorHandling.cpp
parent39d2411c3bc30612fa873f11301ea954d774ff4e (diff)
downloadbcm5719-llvm-f7f6d3e93f739077dc280532d906ca523489b01f.tar.gz
bcm5719-llvm-f7f6d3e93f739077dc280532d906ca523489b01f.zip
[Support] Add the 'Error' class for structured error handling.
This patch introduces the Error classs for lightweight, structured, recoverable error handling. It includes utilities for creating, manipulating and handling errors. The scheme is similar to exceptions, in that errors are described with user-defined types. Unlike exceptions however, errors are represented as ordinary return types in the API (similar to the way std::error_code is used). For usage notes see the LLVM programmer's manual, and the Error.h header. Usage examples can be found in unittests/Support/ErrorTest.cpp. Many thanks to David Blaikie, Mehdi Amini, Kevin Enderby and others on the llvm-dev and llvm-commits lists for lots of discussion and review. llvm-svn: 263609
Diffstat (limited to 'llvm/lib/Support/ErrorHandling.cpp')
-rw-r--r--llvm/lib/Support/ErrorHandling.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
index 2808bd34af0..c743d388887 100644
--- a/llvm/lib/Support/ErrorHandling.cpp
+++ b/llvm/lib/Support/ErrorHandling.cpp
@@ -19,6 +19,7 @@
#include "llvm/Config/config.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/MutexGuard.h"
@@ -138,6 +139,9 @@ void LLVMResetFatalErrorHandler() {
remove_fatal_error_handler();
}
+void ErrorInfoBase::anchor() {}
+char ErrorInfoBase::ID = 0;
+
#ifdef LLVM_ON_WIN32
#include <winerror.h>
OpenPOWER on IntegriCloud