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

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 6 15:08:22 PDT 2018


jakehehrlich added a comment.

So I think I want to remove -split-dwo as an option all together so that HandleArgs can just not worry about all of this.

For the reasoning on removing -split-dwo (which I'll do in another change today) :

1. Clang can now emit dwo output directly without calling objcopy which was the better way to do this all along
2. -split-dwo was litterally never used by anyone. I just invented because it was a better way to do the same fundamental. I never changed clang to actually use this option however.
3. Now that something even better exists, we have an obligation to kill -split-dwo with fire.



================
Comment at: tools/llvm-objcopy/Object.h:631
   virtual std::unique_ptr<Object> create() const = 0;
+  ReaderKind getKind() const { return Kind; }
 };
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D50117





More information about the llvm-commits mailing list