[llvm-readobj] - Refine the error reporting in LLVMStyle<ELFT>::printELFLinkerOptions.
authorGeorgii Rymar <grimar@accesssoftek.com>
Fri, 3 Jul 2020 14:24:09 +0000 (17:24 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Tue, 7 Jul 2020 11:04:17 +0000 (14:04 +0300)
commit0d656cb25dc760cdfe0adfdd7256651b7bd0bcab
tree3ff0e9b61970aea54f13455d712220597ae2ccb2
parent8f0f7dbcea34e2e89fb0946067af3488c20c4532
[llvm-readobj] - Refine the error reporting in LLVMStyle<ELFT>::printELFLinkerOptions.

It is possible to:
1) Avoid using the `unwrapOrError` calls and hence allow to continue dumping even when
   something is not OK with one of SHT_LLVM_LINKER_OPTIONS sections.
2) replace `reportWarning` with `reportUniqueWarning` calls. In this method it is no-op,
   because it is not possible to have a duplicated warnings anyways, but since we probably
   want to switch to `reportUniqueWarning` globally, this is a good thing to do.

This patch addresses both these points.

Differential revision: https://reviews.llvm.org/D83131
llvm/test/tools/llvm-readobj/ELF/linker-options.test
llvm/tools/llvm-readobj/ELFDumper.cpp