[all-commits] [llvm/llvm-project] f671ad: [llvm-readobj] - Use cantFail() for all `Obj->sect...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Fri Jul 3 06:27:44 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f671adf82326da41e48714ebdc362bc4323b6320
      https://github.com/llvm/llvm-project/commit/f671adf82326da41e48714ebdc362bc4323b6320
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-07-03 (Fri, 03 Jul 2020)

  Changed paths:
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list