[PATCH] D54917: [ELF] Delete TargetInfo::getPltEntryOffset and simplify Symbol::getPltVA

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 15:27:25 PST 2018


MaskRay added a comment.

There are pros and cons. It makes the code slightly longer. The duplication mostly happens in  `getPltEntryOffset(Index);` call sites in `X86_64 X86 SPARCV9`

  - uint64_t Off = getPltEntryOffset(Index);
  + uint64_t Off = PltHeaderSize + Index * PltEntrySize;

The advantage is that a casual reader does not need to read the definition of `getPltEntryOffset` to understand how the offsets are computed. I am biased but I find such duplication tolerable.


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D54917





More information about the llvm-commits mailing list