llvm/tools/llvm-readobj
Kevin Enderby 813e0cf966 Thread Expected<...> up from libObject’s getName() for symbols to allow llvm-objdump to produce a good error message.
Produce another specific error message for a malformed Mach-O file when a symbol’s
string index is past the end of the string table.  The existing test case in test/Object/macho-invalid.test
for macho-invalid-symbol-name-past-eof now reports the error with the message indicating
that a symbol at a specific index has a bad sting index and that bad string index value.
 
Again converting interfaces to Expected<> from ErrorOr<> does involve
touching a number of places. Where the existing code reported the error with a
string message or an error code it was converted to do the same.  There is some
code for this that could be factored into a routine but I would like to leave that for
the code owners post-commit to do as they want for handling an llvm::Error.  An
example of how this could be done is shown in the diff in
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h which had a Check() routine
already for std::error_code so I added one like it for llvm::Error .

Also there some were bugs in the existing code that did not deal with the
old ErrorOr<> return values.  So now with Expected<> since they must be
checked and the error handled, I added a TODO and a comment:
“// TODO: Actually report errors helpfully” and a call something like
consumeError(NameOrErr.takeError()) so the buggy code will not crash
since needed to deal with the Error.

Note there fixes needed to lld that goes along with this that I will commit right after this.
So expect lld not to built after this commit and before the next one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20 21:24:34 +00:00
..
ARMAttributeParser.cpp Silencing warnings from MSVC 2015 Update 2. All of these changes silence "C4334 '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)". NFC. 2016-03-30 21:30:00 +00:00
ARMAttributeParser.h [ARM] Add DSP build attribute and extension targeting 2016-01-25 11:26:11 +00:00
ARMEHABIPrinter.h Thread Expected<...> up from libObject’s getName() for symbols to allow llvm-objdump to produce a good error message. 2016-04-20 21:24:34 +00:00
ARMWinEHPrinter.cpp Thread Expected<...> up from libObject’s getName() for symbols to allow llvm-objdump to produce a good error message. 2016-04-20 21:24:34 +00:00
ARMWinEHPrinter.h
CMakeLists.txt
CodeView.h Silence gcc warning about ternary and enumerations 2016-01-28 23:59:35 +00:00
COFFDumper.cpp Thread Expected<...> up from libObject’s getName() for symbols to allow llvm-objdump to produce a good error message. 2016-04-20 21:24:34 +00:00
COFFImportDumper.cpp
ELFDumper.cpp [llvm-readobj] Add ELF hash histogram printing 2016-04-11 17:15:30 +00:00
Error.cpp
Error.h
llvm-readobj.cpp [llvm-readobj] Add ELF hash histogram printing 2016-04-11 17:15:30 +00:00
llvm-readobj.h Thread Expected<...> up from libObject’s getName() for symbols to allow llvm-objdump to produce a good error message. 2016-04-20 21:24:34 +00:00
LLVMBuild.txt
MachODumper.cpp Thread Expected<...> up from libObject’s getName() for symbols to allow llvm-objdump to produce a good error message. 2016-04-20 21:24:34 +00:00
ObjDumper.cpp [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
ObjDumper.h [llvm-readobj] Add ELF hash histogram printing 2016-04-11 17:15:30 +00:00
StackMapPrinter.h
StreamWriter.cpp [llvm-readobj] Impl GNU style printing of sections and relocations 2016-03-15 17:25:31 +00:00
StreamWriter.h [llvm-readobj] Impl GNU style printing of sections and relocations 2016-03-15 17:25:31 +00:00
Win64EHDumper.cpp Thread Expected<...> up from libObject’s getName() for symbols to allow llvm-objdump to produce a good error message. 2016-04-20 21:24:34 +00:00
Win64EHDumper.h