17 #include "llvm/Config/config.h"
20 #if LLVM_ENABLE_ZLIB == 1 && HAVE_ZLIB_H
26 #if LLVM_ENABLE_ZLIB == 1 && HAVE_LIBZ
38 switch (ReturnValue) {
52 unsigned long CompressedSize = ::compressBound(InputBuffer.
size());
53 CompressedBuffer.
resize(CompressedSize);
56 (Bytef *)CompressedBuffer.
data(), &CompressedSize,
57 (
const Bytef *)InputBuffer.
data(), InputBuffer.
size(), CLevel));
61 CompressedBuffer.
resize(CompressedSize);
66 size_t &UncompressedSize) {
68 ::
uncompress((Bytef *)UncompressedBuffer, (uLongf *)&UncompressedSize,
69 (
const Bytef *)InputBuffer.
data(), InputBuffer.
size()));
78 size_t UncompressedSize) {
79 UncompressedBuffer.
resize(UncompressedSize);
81 uncompress(InputBuffer, UncompressedBuffer.
data(), UncompressedSize);
82 UncompressedBuffer.
resize(UncompressedSize);
98 size_t &UncompressedSize) {
103 size_t UncompressedSize) {
static int encodeZlibCompressionLevel(zlib::CompressionLevel Level)
static zlib::Status encodeZlibReturnValue(int ReturnValue)
Status compress(StringRef InputBuffer, SmallVectorImpl< char > &CompressedBuffer, CompressionLevel Level=DefaultCompression)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Status uncompress(StringRef InputBuffer, char *UncompressedBuffer, size_t &UncompressedSize)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
#define __msan_unpoison(p, size)
uint32_t crc32(StringRef Buffer)
pointer data()
Return a pointer to the vector's buffer, even if empty().
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
StringRef - Represent a constant reference to a string, i.e.