[PATCH] D31654: [LLD][ELF] Make createThunks a class [NFC]

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 03:03:08 PDT 2017


peter.smith created this revision.

The main loop for range extension thunks will be something like.

  assignAddresses();
  while (createThunks()) {
      applySynthetic( ... );
      assignAddresses();
  }

createThunks() will need to retain state about the Thunks that it has added so that it can reuse existing thunks. This change is a straight conversion of createThunks into a class so that the state can be retained across calls. The majority of the rangeThunks implementation will be extending this class.

I've kept the class in Relocations.h/Relocations.cpp. It may be better to move this to Thunks.h/Thunks.cpp, the only static functions from Relocations.hpp used will be fromPlt and toPlt.

Alternative ideas:

- The class could be static so that createThunks() could remain the interface to it.
- The state could be separated and passed in to createThunks as a parameter


https://reviews.llvm.org/D31654

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31654.94024.patch
Type: text/x-patch
Size: 7688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170404/cbaf6b60/attachment.bin>


More information about the llvm-commits mailing list