[PATCH] D83126: [llvm-readobj] - Use cantFail() for all `Obj->sections()` calls. NFCI.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 3 04:49:43 PDT 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added a subscriber: rupprecht.
Herald added a project: LLVM.

`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.


https://reviews.llvm.org/D83126

Files:
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83126.275366.patch
Type: text/x-patch
Size: 7417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200703/34d775cb/attachment.bin>


More information about the llvm-commits mailing list