[PATCH] D59017: [llvm-objcopy] - Remove dead code. NFCI.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 04:52:24 PST 2019


jhenderson added inline comments.


================
Comment at: tools/llvm-objcopy/ELF/Object.cpp:184
 template <class ELFT>
 void ELFSectionWriter<ELFT>::visit(const DecompressedSection &Sec) {
   const size_t DataOffset = isDataGnuCompressed(Sec.OriginalData)
----------------
grimar wrote:
> jhenderson wrote:
> > I wonder if it's worth making zlib::isAvailable() an assertion in this function?
> I think it might be better to have an assert in DecompressedSection's constructor then.
> This section is not expected to be created in case of `!zlib::isAvailable()` first of all.
Actually, it's moot, since there is an llvm_unreachable assertion in `zlib::uncompress` is called when it isn't available, so no need for the assertion at all, I think, although it doesn't hurt to have one in the constructor if you want to add it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59017/new/

https://reviews.llvm.org/D59017





More information about the llvm-commits mailing list