llvm-project/llvm/tools/llvm-objdump
Kevin Enderby 42398051d8 Finish cleaning up most of the error handling in libObject’s MachOUniversalBinary
and its clients to use the new llvm::Error model for error handling.

Changed getAsArchive() from ErrorOr<...> to Expected<...> so now all
interfaces there use the new llvm::Error model for return values.

In the two places it had if (!Parent) this is actually a program error so changed
from returning errorCodeToError(object_error::parse_failed) to calling
report_fatal_error() with a message.

In getObjectForArch() added error messages to its two llvm::Error return values
instead of returning errorCodeToError(object_error::arch_not_found) with no
error message.

For the llvm-obdump, llvm-nm and llvm-size clients since the only binary files in
Mach-O Universal Binaries that are supported are Mach-O files or archives with
Mach-O objects, updated their logic to generate an error when a slice contains
something like an ELF binary instead of ignoring it. And added a test case for
that.

The last error stuff to be cleaned up for libObject’s MachOUniversalBinary is
the use of errorOrToExpected(Archive::create(ObjBuffer)) which needs
Archive::create() to be changed from ErrorOr<...> to Expected<...> first,
which I’ll work on next. 

llvm-svn: 274079
2016-06-28 23:16:13 +00:00
..
CMakeLists.txt [CMake] Restrict libxar linkage to just llvm-objdump 2016-05-26 16:32:40 +00:00
COFFDump.cpp [Object, COFF] An import data directory might not consist soley of imports 2016-06-26 04:36:32 +00:00
ELFDump.cpp Simplify iterating over program headers and detect corrupt ones. 2015-07-20 13:35:33 +00:00
LLVMBuild.txt Move DebugInfo to DebugInfo/DWARF. 2015-01-30 18:07:45 +00:00
MachODump.cpp Finish cleaning up most of the error handling in libObject’s MachOUniversalBinary 2016-06-28 23:16:13 +00:00
llvm-objdump.cpp Finish cleaning up most of the error handling in libObject’s MachOUniversalBinary 2016-06-28 23:16:13 +00:00
llvm-objdump.h Finish cleaning up most of the error handling in libObject’s MachOUniversalBinary 2016-06-28 23:16:13 +00:00