1. Recommit r369190 "[llvm-readobj/llvm-readelf] - Improve/cleanup the (details)
Commit e3fb2d549b6820ab60806240cbf69e7447e71a86 by grimar
Recommit r369190 "[llvm-readobj/llvm-readelf] - Improve/cleanup the
error reporting API."
Fix: Add a `consumeError` call removed by mistake to 'printStackSize',
this should fix the "Expected<T> must be checked before access or
destruction." reported by following bot:
Original commit message: Currently we have the following functions for
error reporting:
LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg); void
reportError(Error Err, StringRef Input);  void reportWarning(Twine Msg);
void reportWarning(StringRef Input, Error Err); void warn(llvm::Error
Err); void error(std::error_code EC);
Problems are: naming is inconsistent, arguments order is inconsistent,
some of the functions looks excessive.
After applying this patch we have:
void reportError(Error Err, StringRef Input);  void
reportError(std::error_code EC, StringRef Input); void
reportWarning(Error Err, StringRef Input);
I'd be happy to remove reportError(std::error_code EC, StringRef Input)
too, but it is used by COFF heavily.
Test cases were updated, they show an improvement introduced.
Differential revision:
llvm-svn: 369194
The file was modifiedllvm/test/tools/llvm-readobj/hex-dump.test (diff)
The file was modifiedllvm/tools/llvm-readobj/COFFDumper.cpp (diff)
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp (diff)
The file was modifiedllvm/tools/llvm-readobj/ObjDumper.cpp (diff)
The file was modifiedllvm/test/tools/llvm-readobj/string-dump.test (diff)
The file was modifiedllvm/tools/llvm-readobj/llvm-readobj.h (diff)
The file was modifiedllvm/test/tools/llvm-readobj/mips-got.test (diff)
The file was modifiedllvm/test/tools/llvm-readobj/note-core-ntfile-bad.test (diff)
The file was modifiedllvm/tools/llvm-readobj/DwarfCFIEHPrinter.h (diff)
The file was modifiedllvm/test/tools/llvm-readobj/elf-dynamic-malformed.test (diff)
The file was modifiedllvm/test/Object/invalid.test (diff)
The file was modifiedllvm/test/tools/llvm-readobj/elf-broken-dynsym-link.test (diff)
The file was modifiedllvm/tools/llvm-readobj/llvm-readobj.cpp (diff)
The file was modifiedllvm/test/tools/llvm-readobj/elf-dynamic-not-in-pt-dynamic.test (diff)
The file was modifiedllvm/test/tools/llvm-readobj/elf-malformed-pt-dynamic.test (diff)
The file was modifiedllvm/tools/llvm-readobj/MachODumper.cpp (diff)
The file was modifiedllvm/test/tools/llvm-readobj/elf-non-dynamic-in-pt-dynamic.test (diff)