diff options
-rw-r--r-- | lld/ELF/Error.cpp | 5 | ||||
-rw-r--r-- | lld/ELF/Error.h | 8 |
2 files changed, 2 insertions, 11 deletions
diff --git a/lld/ELF/Error.cpp b/lld/ELF/Error.cpp index beda4af658c..991ec97d056 100644 --- a/lld/ELF/Error.cpp +++ b/lld/ELF/Error.cpp @@ -36,11 +36,6 @@ void error(std::error_code EC, const Twine &Prefix) { error(Prefix + ": " + EC.message()); } -void error(std::error_code EC) { - if (EC) - error(EC.message()); -} - void fatal(const Twine &Msg) { llvm::errs() << Msg << "\n"; exit(1); diff --git a/lld/ELF/Error.h b/lld/ELF/Error.h index 05a3e0a56a9..afa51b98606 100644 --- a/lld/ELF/Error.h +++ b/lld/ELF/Error.h @@ -23,18 +23,14 @@ void warning(const Twine &Msg); void error(const Twine &Msg); void error(std::error_code EC, const Twine &Prefix); -void error(std::error_code EC); template <typename T> void error(const ErrorOr<T> &V, const Twine &Prefix) { - return error(V.getError(), Prefix); -} - -template <typename T> void error(const ErrorOr<T> &V) { - return error(V.getError()); + error(V.getError(), Prefix); } LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg); LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg, const Twine &Prefix); + void check(std::error_code EC); template <class T> T check(ErrorOr<T> EO) { |