[PATCH] D50117: [llvm-objcopy] NFC: Refactor main objcopy method that takes an ELFReader to a generic Reader.

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 16:37:41 PDT 2018


rupprecht created this revision.
rupprecht added reviewers: jakehehrlich, alexshap, jhenderson.
Herald added a subscriber: llvm-commits.

Refactor the main transformation method (ExecuteElfObjcopyOnBinary) to be agnostic of which Reader subclass (currently ELFReader) is passed in.

This adds RTTI to the Reader class so that we can infer the ELF output type from the input reader. As a TODO, we should explicitly require this to be set by the --binary-architechture flag if the Reader is a BinaryReader.

This is a small refactoring in preparation for implementing BinaryReader (see also https://reviews.llvm.org/D41687). It should have no functional change.


Repository:
  rL LLVM

https://reviews.llvm.org/D50117

Files:
  tools/llvm-objcopy/Object.cpp
  tools/llvm-objcopy/Object.h
  tools/llvm-objcopy/llvm-objcopy.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50117.158418.patch
Type: text/x-patch
Size: 5489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180731/a907733e/attachment.bin>


More information about the llvm-commits mailing list