llvm.org GIT mirror llvm / 2f60e62
[Object] isNotObjectErrorInvalidFileType: simplify git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365997 91177308-0d34-0410-b5e6-96231b3b80d8 Fangrui Song a month ago
1 changed file(s) with 10 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
7777 }
7878
7979 llvm::Error llvm::object::isNotObjectErrorInvalidFileType(llvm::Error Err) {
80 if (auto Err2 =
81 handleErrors(std::move(Err), [](std::unique_ptr M) -> Error {
82 // Try to handle 'M'. If successful, return a success value from
83 // the handler.
84 if (M->convertToErrorCode() == object_error::invalid_file_type)
85 return Error::success();
80 return handleErrors(std::move(Err), [](std::unique_ptr M) -> Error {
81 // Try to handle 'M'. If successful, return a success value from
82 // the handler.
83 if (M->convertToErrorCode() == object_error::invalid_file_type)
84 return Error::success();
8685
87 // We failed to handle 'M' - return it from the handler.
88 // This value will be passed back from catchErrors and
89 // wind up in Err2, where it will be returned from this function.
90 return Error(std::move(M));
91 }))
92 return Err2;
93 return Error::success();
86 // We failed to handle 'M' - return it from the handler.
87 // This value will be passed back from catchErrors and
88 // wind up in Err2, where it will be returned from this function.
89 return Error(std::move(M));
90 });
9491 }