The tests still need to be updated. Before doing that, I would like to get another pair of eyes on the new error messages, in order to avoid to change them many times. Other than that, the transition is complete.
Diff Detail
Event Timeline
This enables quite a few followup cleanups, so LGTM with just a few nits.
include/llvm/Object/ELF.h | ||
---|---|---|
172 | At some point this should all be inconvertibleErrorCode. For now, can you always use object_error::parse_failed? With the string we don't need the various enums. How about for now just adding a helper function: static StringError createError(StringRef Err) { return make_error<StringError>(Err, object_error::parse_failed); } That way we only have to update one place in a followup patch. | |
387 | You don't need this comment anymore. | |
tools/llvm-objdump/llvm-objdump.cpp | ||
621 | This is in tools, I wonder why it doesn't just fail fast. In any case, that is for another patch. | |
tools/llvm-readobj/ARMEHABIPrinter.h | ||
354 | Don't we have an error that takes an Error so that you don't have to call errorToErrorCode? |
Looks fine with the following wording changes and what rafael requested.
include/llvm/Object/ELF.h | ||
---|---|---|
267 | invalid section offset | |
414 | invalid section offset | |
432 | invalid sh_type for string table, expected SHT_STRTAB | |
494 | invalid sh_type for symbol table, expected SHT_SYMTAB or SHT_DYNSYM | |
521 | invalid string offset |
include/llvm/Object/ELF.h | ||
---|---|---|
172 | I thought the same (about using parse_failed everywhere, but wanted to do in a follow-up). Anyway, it's a good idea so I did it now. | |
267 | Thanks for auditing the message, Spency | |
387 | Done. | |
tools/llvm-objdump/llvm-objdump.cpp | ||
621 | I agree. Not quite fond of llvm-objdump, I'll open a bug. | |
tools/llvm-readobj/ARMEHABIPrinter.h | ||
354 | Yes, we do. In fact, I used it 10 lines below, but I forgot here =) |
Committed upstream. I find amusing that I found a thread where we discussed this more than one year ago (I completely forgot about it) =)
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/293003.html
At some point this should all be inconvertibleErrorCode. For now, can you always use object_error::parse_failed? With the string we don't need the various enums.
How about for now just adding a helper function:
static StringError createError(StringRef Err) {
}
That way we only have to update one place in a followup patch.