16 #include "llvm/Config/config.h" 20 #if LLVM_ENABLE_ZLIB == 1 && HAVE_ZLIB_H 26 #if LLVM_ENABLE_ZLIB == 1 && HAVE_LIBZ 34 return "zlib error: Z_MEM_ERROR";
36 return "zlib error: Z_BUF_ERROR";
38 return "zlib error: Z_STREAM_ERROR";
40 return "zlib error: Z_DATA_ERROR";
51 unsigned long CompressedSize = ::compressBound(InputBuffer.
size());
52 CompressedBuffer.
reserve(CompressedSize);
54 ::compress2((Bytef *)CompressedBuffer.
data(), &CompressedSize,
55 (
const Bytef *)InputBuffer.
data(), InputBuffer.
size(),
Level);
59 CompressedBuffer.
set_size(CompressedSize);
64 size_t &UncompressedSize) {
66 ::uncompress((Bytef *)UncompressedBuffer, (uLongf *)&UncompressedSize,
67 (
const Bytef *)InputBuffer.
data(), InputBuffer.
size());
76 size_t UncompressedSize) {
77 UncompressedBuffer.
resize(UncompressedSize);
79 uncompress(InputBuffer, UncompressedBuffer.
data(), UncompressedSize);
80 UncompressedBuffer.
resize(UncompressedSize);
95 size_t &UncompressedSize) {
100 size_t UncompressedSize) {
This class represents lattice values for constants.
void reserve(size_type N)
static Error createError(const Twine &Err)
Error compress(StringRef InputBuffer, SmallVectorImpl< char > &CompressedBuffer, int Level=DefaultCompression)
LLVM_NODISCARD size_t size() const
size - Get the string size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void set_size(size_t N)
Set the array size to N, which the current array must have enough capacity for.
static StringRef convertZlibCodeToString(int Code)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static ErrorSuccess success()
Create a success value.
#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 const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
Error uncompress(StringRef InputBuffer, char *UncompressedBuffer, size_t &UncompressedSize)
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...