[PATCH] D130458: [llvm-objcopy] Support --{,de}compress-debug-sections for zstd

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 13:45:17 PDT 2022


MaskRay added a comment.

Thanks for the replys! Personally I think the object-oriented style design is a bit overkill. I think most call sites really don't care about constructing a compression/decompression class. A free function call like

  compression::Param P;
  P.Format = CompressionType;
  // Some callers may want to set --threads here. The user needs to be aware that different threads may lead to different output. For the same number of threads, the output should be deterministic, as guaranteed by zstd.
  compression::compress(P, OriginalData, CompressedData);

is just fine. If you can simplify the OO enough so that there is less boilerplate for each call site, happy to take another look. Note: even if an OO design is used, it's possible that we may want to introduce free functions and the end result looks exactly very similar to this patch.

If you consider that even if D130506 <https://reviews.llvm.org/D130506> is not the final form, it will be close enough to the final form. We can push the two patches and you can continue refining the interface.
The llvm-objcopy serves as an example for you to add support for other components.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130458



More information about the llvm-commits mailing list