[PATCH] D33153: Alternative way to detemplate GotSection

Rafael Ávila de Espíndola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 14:31:01 PDT 2017


rafael created this revision.

GetSection is a template because write calls relocate.

relocate has two parts. The non alloc code really has to be a template, as it is looking a raw input file data.

The alloc part is only a template because of getSize.

This patch folds the value of getSize early, detemplates getRelocTargetVA and splits relocate into a templated non alloc case and a regular function for the alloc case.

Since we know got is alloc, it can just call the function directly and avoid the template.


https://reviews.llvm.org/D33153

Files:
  ELF/InputSection.cpp
  ELF/InputSection.h
  ELF/Relocations.cpp
  ELF/SyntheticSections.cpp
  ELF/SyntheticSections.h
  ELF/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33153.98843.patch
Type: text/x-patch
Size: 8814 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170512/650b8199/attachment.bin>


More information about the llvm-commits mailing list