summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Compression.cpp
diff options
context:
space:
mode:
authorAhmed Charles <ahmedcharles@gmail.com>2014-03-06 05:51:42 +0000
committerAhmed Charles <ahmedcharles@gmail.com>2014-03-06 05:51:42 +0000
commit56440fd8203f581b9aded68db3631ea11a72ccf2 (patch)
tree7f80c03b91a2d762573379b2624e3f1de93e6ab6 /llvm/lib/Support/Compression.cpp
parent47c254beb732a4434f814c4415cbc60503dd331a (diff)
downloadbcm5719-llvm-56440fd8203f581b9aded68db3631ea11a72ccf2.tar.gz
bcm5719-llvm-56440fd8203f581b9aded68db3631ea11a72ccf2.zip
Replace OwningPtr<T> with std::unique_ptr<T>.
This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
Diffstat (limited to 'llvm/lib/Support/Compression.cpp')
-rw-r--r--llvm/lib/Support/Compression.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Support/Compression.cpp b/llvm/lib/Support/Compression.cpp
index b5ddb7002ca..5e5336144ab 100644
--- a/llvm/lib/Support/Compression.cpp
+++ b/llvm/lib/Support/Compression.cpp
@@ -12,7 +12,6 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Compression.h"
-#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/config.h"
#include "llvm/Support/Compiler.h"
@@ -48,10 +47,10 @@ static zlib::Status encodeZlibReturnValue(int ReturnValue) {
bool zlib::isAvailable() { return true; }
zlib::Status zlib::compress(StringRef InputBuffer,
- OwningPtr<MemoryBuffer> &CompressedBuffer,
+ std::unique_ptr<MemoryBuffer> &CompressedBuffer,
CompressionLevel Level) {
unsigned long CompressedSize = ::compressBound(InputBuffer.size());
- OwningArrayPtr<char> TmpBuffer(new char[CompressedSize]);
+ std::unique_ptr<char[]> TmpBuffer(new char[CompressedSize]);
int CLevel = encodeZlibCompressionLevel(Level);
Status Res = encodeZlibReturnValue(::compress2(
(Bytef *)TmpBuffer.get(), &CompressedSize,
@@ -66,9 +65,9 @@ zlib::Status zlib::compress(StringRef InputBuffer,
}
zlib::Status zlib::uncompress(StringRef InputBuffer,
- OwningPtr<MemoryBuffer> &UncompressedBuffer,
+ std::unique_ptr<MemoryBuffer> &UncompressedBuffer,
size_t UncompressedSize) {
- OwningArrayPtr<char> TmpBuffer(new char[UncompressedSize]);
+ std::unique_ptr<char[]> TmpBuffer(new char[UncompressedSize]);
Status Res = encodeZlibReturnValue(
::uncompress((Bytef *)TmpBuffer.get(), (uLongf *)&UncompressedSize,
(const Bytef *)InputBuffer.data(), InputBuffer.size()));
@@ -88,12 +87,12 @@ uint32_t zlib::crc32(StringRef Buffer) {
#else
bool zlib::isAvailable() { return false; }
zlib::Status zlib::compress(StringRef InputBuffer,
- OwningPtr<MemoryBuffer> &CompressedBuffer,
+ std::unique_ptr<MemoryBuffer> &CompressedBuffer,
CompressionLevel Level) {
return zlib::StatusUnsupported;
}
zlib::Status zlib::uncompress(StringRef InputBuffer,
- OwningPtr<MemoryBuffer> &UncompressedBuffer,
+ std::unique_ptr<MemoryBuffer> &UncompressedBuffer,
size_t UncompressedSize) {
return zlib::StatusUnsupported;
}
OpenPOWER on IntegriCloud