summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Error.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-07-14 02:24:01 +0000
committerLang Hames <lhames@gmail.com>2016-07-14 02:24:01 +0000
commitfc209623e976118cf016c0d3c1dccacb6bfa27c1 (patch)
tree407a60990972f87acb6c6aed9c218ac6ab4b203a /llvm/lib/Support/Error.cpp
parentaf7e8465e1fabdfff6c3a08a14cdb83ed79a10dc (diff)
downloadbcm5719-llvm-fc209623e976118cf016c0d3c1dccacb6bfa27c1.tar.gz
bcm5719-llvm-fc209623e976118cf016c0d3c1dccacb6bfa27c1.zip
[Object] Re-apply r275316 now that I have the corresponding LLD patch ready.
llvm-svn: 275361
Diffstat (limited to 'llvm/lib/Support/Error.cpp')
-rw-r--r--llvm/lib/Support/Error.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Support/Error.cpp b/llvm/lib/Support/Error.cpp
index df540d10bc5..6b22691eb1a 100644
--- a/llvm/lib/Support/Error.cpp
+++ b/llvm/lib/Support/Error.cpp
@@ -64,6 +64,7 @@ void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner) {
});
}
+
std::error_code ErrorList::convertToErrorCode() const {
return std::error_code(static_cast<int>(ErrorErrorCode::MultipleErrors),
*ErrorErrorCat);
@@ -99,4 +100,14 @@ std::error_code StringError::convertToErrorCode() const {
return EC;
}
+void report_fatal_error(Error Err, bool GenCrashDiag) {
+ assert(Err && "report_fatal_error called with success value");
+ std::string ErrMsg;
+ {
+ raw_string_ostream ErrStream(ErrMsg);
+ logAllUnhandledErrors(std::move(Err), ErrStream, "");
+ }
+ report_fatal_error(ErrMsg);
+}
+
}
OpenPOWER on IntegriCloud