[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
Wed Aug 8 09:16:57 PDT 2018


rupprecht abandoned this revision.
rupprecht added a comment.

https://reviews.llvm.org/D50343 includes (some of) the changes here, so I'm officially abandoning this -- it makes more sense to discuss the design on something concrete.



================
Comment at: tools/llvm-objcopy/Object.h:631
   virtual std::unique_ptr<Object> create() const = 0;
+  ReaderKind getKind() const { return Kind; }
 };
----------------
jakehehrlich wrote:
> So I realized (thanks to the other change) that it does not really make sense to put getKind here.  I think this is what James was pointing out already but I was just not thinking clearly. I apologize. ELFReader *should* have this as a means of telling us what was read in but Reader should not. The ELFType should be determined using the machine info and be passed to handle args as it was before. If If it weren't for -split-dwo (which quite frankly is kind of a dumb option now that a better alternative exists) we would pass the Writer directly to HandleArgs. The only other planned option is a -split-debug option but that only makes sense for the ELF input format case so when that's implemented it can be moved elsewhere.
I ended up not needing to add llvm's RTTI here, so getKind has been reverted in D50343. I thought I knew where I was going when I sent this prefactoring, but it turns out I didn't.


Repository:
  rL LLVM

https://reviews.llvm.org/D50117





More information about the llvm-commits mailing list