[PATCH] D83935: [llvm-readobj] - Move out the common code from printRelocations() methods.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 01:41:08 PDT 2020


grimar marked an inline comment as done.
grimar added inline comments.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:5592
+                                             PrintRelaFn PrintRela,
+                                             PrintRelrFn PrintRelr) {
+  const Elf_Shdr *SymTab =
----------------
MaskRay wrote:
> I am a bit unsure this simplifies the code (number of lines increased...).
> 
> We changed two dispatching switches to 3 lambdas plus 2 dispatching switches? Did not see how the new organization simplifies code or improves readability...
This method has 6 `unwrapOrError` calls and now shares the logic which previously was duplicated.
With this patch we will be able to replace these `unwrapOrError` calls with a proper error reporting code in a single shared place.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83935/new/

https://reviews.llvm.org/D83935





More information about the llvm-commits mailing list