[PATCH] D84323: [llvm-readelf/readobj] - Detemplate printRelRelaReloc() methods.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 06:52:16 PDT 2020


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

Methods became templated in D83871 <https://reviews.llvm.org/D83871>.

D83935 <https://reviews.llvm.org/D83935> tries to move out the common code and I had to introduce
2 more virtual methods: `printRelReloc` and `printRelReloc` to call
the templated `printRelRelaReloc` from the base class,
where the common code lives.

This patch shows that we can call `printRelRelaReloc` directly from the
base class after making it virtual and detemplating it.

The benefit is that the code becomes shorter. But instead of having just
`Elf_Rel`/`Elf_Rela` argument, we will have two: `const Elf_Rel &R, Optional<int64_t> Addend`

Should we do it?


https://reviews.llvm.org/D84323

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84323.279805.patch
Type: text/x-patch
Size: 15773 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200722/fc6ca0aa/attachment.bin>


More information about the llvm-commits mailing list