[PATCH] D130506: [Support] Add llvm::compression::{isAvailable,compress,uncompress}
Cole Kissane via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 25 13:46:39 PDT 2022
ckissane added a comment.
In D130506#3677033 <https://reviews.llvm.org/D130506#3677033>, @dblaikie wrote:
> @ckissane sounded like you/your colleagues already had some outstanding patches/plans to generalize the compression support - should we be considering those patches/directions alongside this one?
>
> I'd had in mind something like a compression algorithm base class, two (or three, if it's useful to have a default implementation for "None") derived classes, singleton instances of each and a function that takes the algorithm type and returns the handler - which can then be queried for "is available" and provides compress/decompress actions. That'd mean having only one switch instead of three, but the three are now so close together that it's not hugely painful to maintain (though having a class hierarchy would ensure the APIs were actually identical, whereas currently they're only identical by convention).
@dblaikie indeed I do!
I have some work on https://github.com/ckissane/llvm-project/tree/ckissane.compression-class that I will put into a patch shortly!
It does exactly what you said, makes a base class, a none class, and zstd and zlib classes for compression, and refactors code to take advantage of this.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130506/new/
https://reviews.llvm.org/D130506
More information about the llvm-commits
mailing list