[llvm-readobj] - Use cantFail() for all `Obj->sections()` calls. NFCI.
authorGeorgii Rymar <grimar@accesssoftek.com>
Fri, 3 Jul 2020 11:17:08 +0000 (14:17 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Fri, 3 Jul 2020 13:25:20 +0000 (16:25 +0300)
commitf671adf82326da41e48714ebdc362bc4323b6320
tree660713b263f36eefe2a3c322c37dc59ccb94d2dc
parent38909f31bd085d255e4b20e6da1d74b147e5f76a
[llvm-readobj] - Use cantFail() for all `Obj->sections()` calls. NFCI.

`ELFDumper<ELFT>::ELFDumper` calls `Obj->sections()` in its constructor:
https://github.com/llvm/llvm-project/blob/master/llvm/tools/llvm-readobj/ELFDumper.cpp#L2046

this means that all subsequent calls can't fail and can be
wrapped into `cantFail` in instead of `unwrapOrError` for simplicity.

Actually we already do it in a few places. In this patch I've fixed all
other places I've found.

Differential revision: https://reviews.llvm.org/D83126
llvm/tools/llvm-readobj/ELFDumper.cpp