[PATCH] D130516: [llvm] compression classes

Cole Kissane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 4 14:55:35 PDT 2022

ckissane added a comment.

@dblaikie @MaskRay I would like it if you could all take another look.

In response to @dblaikie 's comments about implementation weight I have greatly simplified the implementation, including removing extra capitalized function overloads (Compress, Decompress), and removing || and && operator overrides. Also adopting the recently suggested class impl in part.

I also believe similar semantics to the nullptr suggestion have been achieved, due to the bool cast returning supported status, and the Unknown type acting as a nullptr of sorts, being always unsupported and -1 (255) as a uint8. `Optional(Unknown)` is returned from `getOptionalCompressionKind(uint8_t)` when it is not 0 (NoneType()), 1 (`Optional(Zlib)`), or 2 (`Optional(ZStd)`).

In places where explict compression must be used `CompressionKind` can be passed around, and possibly optional (sometimes none) compression is represented as `llvm::Optional<CompressionKind>` which I have type aliased as `OptionalCompressionKind`

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list