[PATCH] D74545: [llvm-readobj] - Refactor the code that dumps relocations.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 04:37:42 PST 2020


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

The current code has following issues:

1. It has a duplicated logic part.
2. This logic relies on unwrapOrError calls, but if we want to convert them to warnings, we will need to change all of them what is hard to do because of the duplication.

In this patch I've created a new method that returns Expected<> what allows
now to catch all errors in a single place and remove the code duplication.

Note: this change is itself a refactor NFC. It does not change the current logic
anyhow. It prepares the code for the follow-up(s).


https://reviews.llvm.org/D74545

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74545.244386.patch
Type: text/x-patch
Size: 4279 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200213/5c1e5a6c/attachment.bin>


More information about the llvm-commits mailing list