From b206103abcf358453ac4ed8d4373f44f4c88e5c0 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sat, 5 Apr 2014 21:26:44 +0000 Subject: Simplify compression API by decompressing into a SmallVector rather than a MemoryBuffer This avoids an extra copy during decompression and avoids the use of MemoryBuffer which is a weirdly esoteric device that includes unrelated concepts like "file name" (its rather generic name is a bit misleading). Similar refactoring of zlib::compress coming up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205676 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/Compression.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/llvm') diff --git a/include/llvm/Support/Compression.h b/include/llvm/Support/Compression.h index 80eff5c628..2629809286 100644 --- a/include/llvm/Support/Compression.h +++ b/include/llvm/Support/Compression.h @@ -16,6 +16,7 @@ #include "llvm/Support/DataTypes.h" #include +#include "llvm/ADT/SmallVector.h" namespace llvm { @@ -47,7 +48,7 @@ Status compress(StringRef InputBuffer, CompressionLevel Level = DefaultCompression); Status uncompress(StringRef InputBuffer, - std::unique_ptr &UncompressedBuffer, + SmallVectorImpl &UncompressedBuffer, size_t UncompressedSize); uint32_t crc32(StringRef Buffer); -- cgit v1.2.3