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);
67 size_t UncompressedSize) {
68 UncompressedBuffer.
resize(UncompressedSize);
70 (Bytef *)UncompressedBuffer.
data(), (uLongf *)&UncompressedSize,
71 (
const Bytef *)InputBuffer.
data(), InputBuffer.
size()));
75 UncompressedBuffer.
resize(UncompressedSize);
92 size_t UncompressedSize) {
static int encodeZlibCompressionLevel(zlib::CompressionLevel Level)
size_t size() const
size - Get the string size.
static zlib::Status encodeZlibReturnValue(int ReturnValue)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Status compress(StringRef InputBuffer, SmallVectorImpl< char > &CompressedBuffer, CompressionLevel Level=DefaultCompression)
const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
#define __msan_unpoison(p, size)
uint32_t crc32(StringRef Buffer)
Status uncompress(StringRef InputBuffer, SmallVectorImpl< char > &UncompressedBuffer, size_t UncompressedSize)
pointer data()
Return a pointer to the vector's buffer, even if empty().
StringRef - Represent a constant reference to a string, i.e.