diff options
Diffstat (limited to 'contrib/llvm/lib/Object/Error.cpp')
-rw-r--r-- | contrib/llvm/lib/Object/Error.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/contrib/llvm/lib/Object/Error.cpp b/contrib/llvm/lib/Object/Error.cpp index 2357526..7d43a84 100644 --- a/contrib/llvm/lib/Object/Error.cpp +++ b/contrib/llvm/lib/Object/Error.cpp @@ -24,12 +24,12 @@ namespace { // deal with the Error value directly, rather than converting to error_code. class _object_error_category : public std::error_category { public: - const char* name() const LLVM_NOEXCEPT override; + const char* name() const noexcept override; std::string message(int ev) const override; }; } -const char *_object_error_category::name() const LLVM_NOEXCEPT { +const char *_object_error_category::name() const noexcept { return "llvm.object"; } @@ -50,6 +50,8 @@ std::string _object_error_category::message(int EV) const { return "Invalid section index"; case object_error::bitcode_section_not_found: return "Bitcode section not found in object file"; + case object_error::invalid_symbol_index: + return "Invalid symbol index"; } llvm_unreachable("An enumerator of object_error does not have a message " "defined."); @@ -77,18 +79,17 @@ const std::error_category &object::object_category() { llvm::Error llvm::object::isNotObjectErrorInvalidFileType(llvm::Error Err) { if (auto Err2 = - handleErrors(std::move(Err), - [](std::unique_ptr<ECError> M) { - // Try to handle 'M'. If successful, return a success value from - // the handler. - if (M->convertToErrorCode() == object_error::invalid_file_type) - return Error::success(); + handleErrors(std::move(Err), [](std::unique_ptr<ECError> M) -> Error { + // Try to handle 'M'. If successful, return a success value from + // the handler. + if (M->convertToErrorCode() == object_error::invalid_file_type) + return Error::success(); - // We failed to handle 'M' - return it from the handler. - // This value will be passed back from catchErrors and - // wind up in Err2, where it will be returned from this function. - return Error(std::move(M)); - })) + // We failed to handle 'M' - return it from the handler. + // This value will be passed back from catchErrors and + // wind up in Err2, where it will be returned from this function. + return Error(std::move(M)); + })) return Err2; return Err; } |