diff options
Diffstat (limited to 'lib/Object/Error.cpp')
-rw-r--r-- | lib/Object/Error.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/Object/Error.cpp b/lib/Object/Error.cpp index 8e50869..9d25269 100644 --- a/lib/Object/Error.cpp +++ b/lib/Object/Error.cpp @@ -18,11 +18,10 @@ using namespace llvm; using namespace object; namespace { -class _object_error_category : public error_category { +class _object_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; }; } @@ -30,8 +29,8 @@ const char *_object_error_category::name() const { return "llvm.object"; } -std::string _object_error_category::message(int ev) const { - object_error::Impl E = static_cast<object_error::Impl>(ev); +std::string _object_error_category::message(int EV) const { + object_error E = static_cast<object_error>(EV); switch (E) { case object_error::success: return "Success"; case object_error::arch_not_found: @@ -47,13 +46,7 @@ std::string _object_error_category::message(int ev) const { "defined."); } -error_condition _object_error_category::default_error_condition(int ev) const { - if (ev == object_error::success) - return errc::success; - return errc::invalid_argument; -} - -const error_category &object::object_category() { +const std::error_category &object::object_category() { static _object_error_category o; return o; } |