diff options
Diffstat (limited to 'tools/llvm-readobj/Error.cpp')
-rw-r--r-- | tools/llvm-readobj/Error.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/tools/llvm-readobj/Error.cpp b/tools/llvm-readobj/Error.cpp index 83ed6a7..a078f5c 100644 --- a/tools/llvm-readobj/Error.cpp +++ b/tools/llvm-readobj/Error.cpp @@ -17,11 +17,10 @@ using namespace llvm; namespace { -class _readobj_error_category : public error_category { +class _readobj_error_category : public std::error_category { public: - const char* name() const override; + const char* name() const LLVM_NOEXCEPT override; std::string message(int ev) const override; - error_condition default_error_condition(int ev) const override; }; } // namespace @@ -29,8 +28,8 @@ const char *_readobj_error_category::name() const { return "llvm.readobj"; } -std::string _readobj_error_category::message(int ev) const { - switch (ev) { +std::string _readobj_error_category::message(int EV) const { + switch (static_cast<readobj_error>(EV)) { case readobj_error::success: return "Success"; case readobj_error::file_not_found: return "No such file."; @@ -42,20 +41,13 @@ std::string _readobj_error_category::message(int ev) const { return "Unsupported object file format."; case readobj_error::unknown_symbol: return "Unknown symbol."; - default: - llvm_unreachable("An enumerator of readobj_error does not have a message " - "defined."); } -} - -error_condition _readobj_error_category::default_error_condition(int ev) const { - if (ev == readobj_error::success) - return errc::success; - return errc::invalid_argument; + llvm_unreachable("An enumerator of readobj_error does not have a message " + "defined."); } namespace llvm { -const error_category &readobj_category() { +const std::error_category &readobj_category() { static _readobj_error_category o; return o; } |