summaryrefslogtreecommitdiff
path: root/ELF/Error.h
diff options
context:
space:
mode:
Diffstat (limited to 'ELF/Error.h')
-rw-r--r--ELF/Error.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/ELF/Error.h b/ELF/Error.h
index 1ec683595cf4..f18cf456da6d 100644
--- a/ELF/Error.h
+++ b/ELF/Error.h
@@ -44,6 +44,7 @@ void error(std::error_code EC, const Twine &Prefix);
LLVM_ATTRIBUTE_NORETURN void exitLld(int Val);
LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg);
LLVM_ATTRIBUTE_NORETURN void fatal(std::error_code EC, const Twine &Prefix);
+LLVM_ATTRIBUTE_NORETURN void fatal(Error &E, const Twine &Prefix);
// check() functions are convenient functions to strip errors
// from error-or-value objects.
@@ -55,11 +56,7 @@ template <class T> T check(ErrorOr<T> E) {
template <class T> T check(Expected<T> E) {
if (!E)
- handleAllErrors(std::move(E.takeError()),
- [](llvm::ErrorInfoBase &EIB) -> Error {
- fatal(EIB.message());
- return Error::success();
- });
+ fatal(llvm::toString(E.takeError()));
return std::move(*E);
}