Lines Matching refs:zlib
21 #include <zlib.h>
27 static int encodeZlibCompressionLevel(zlib::CompressionLevel Level) {
29 case zlib::NoCompression: return 0;
30 case zlib::BestSpeedCompression: return 1;
31 case zlib::DefaultCompression: return Z_DEFAULT_COMPRESSION;
32 case zlib::BestSizeCompression: return 9;
34 llvm_unreachable("Invalid zlib::CompressionLevel!");
37 static zlib::Status encodeZlibReturnValue(int ReturnValue) {
39 case Z_OK: return zlib::StatusOK;
40 case Z_MEM_ERROR: return zlib::StatusOutOfMemory;
41 case Z_BUF_ERROR: return zlib::StatusBufferTooShort;
42 case Z_STREAM_ERROR: return zlib::StatusInvalidArg;
43 case Z_DATA_ERROR: return zlib::StatusInvalidData;
44 default: llvm_unreachable("unknown zlib return status!");
48 bool zlib::isAvailable() { return true; }
49 zlib::Status zlib::compress(StringRef InputBuffer,
58 // Tell MemorySanitizer that zlib output buffer is fully initialized.
59 // This avoids a false report when running LLVM with uninstrumented ZLib.
65 zlib::Status zlib::uncompress(StringRef InputBuffer,
72 // Tell MemorySanitizer that zlib output buffer is fully initialized.
73 // This avoids a false report when running LLVM with uninstrumented ZLib.
79 uint32_t zlib::crc32(StringRef Buffer) {
84 bool zlib::isAvailable() { return false; }
85 zlib::Status zlib::compress(StringRef InputBuffer,
88 return zlib::StatusUnsupported;
90 zlib::Status zlib::uncompress(StringRef InputBuffer,
93 return zlib::StatusUnsupported;
95 uint32_t zlib::crc32(StringRef Buffer) {
96 llvm_unreachable("zlib::crc32 is unavailable");