[PATCH] D49678: [llvm-objcopy] Adding support for compressed DWARF debug sections.

Puyan Lotfi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 17:28:44 PDT 2018


plotfi marked 8 inline comments as done.
plotfi added inline comments.


================
Comment at: include/llvm/Object/Compressor.h:32
+
+  void writeHeader(support::endian::Writer &W, uint64_t DecompressedSize,
+                   unsigned Alignment, bool Is64Bit, bool IsGnuStyle);
----------------
jakehehrlich wrote:
> plotfi wrote:
> > jakehehrlich wrote:
> > > If possible I'd prefer to use an interface that lets you write to a pointer instead.
> > Why? Other places where I see similar zlib headers being written seem to just write to a stream. I think a stream would be a cleaner interface without any need to worry about sizing. 
> Mainly It's just how things are done in llvm-objcopy so it's mainly for local consistency. This isn't a big point, more a point of preference. Also I think you can avoid a copy of the data that way. Instead of copying it to a stream and then copying that to the final destination you should just be able to copy once from the compressed buffer to the owned data.
I intent to use this library to clean up more than just llvm-objcopy BTW. There are other places in LLVM (like the ELFWriter in ELFObjectWriter.cpp) that use the stream. The Decompressor library also doesn't take a raw pointer either: It just takes a StringRef as input and a MutableArrayRef as output. 


Repository:
  rL LLVM

https://reviews.llvm.org/D49678





More information about the llvm-commits mailing list