diff options
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/CommandLine.cpp | 3 | ||||
-rw-r--r-- | lib/Support/Compression.cpp | 13 | ||||
-rw-r--r-- | lib/Support/FileUtilities.cpp | 5 | ||||
-rw-r--r-- | lib/Support/LockFileManager.cpp | 2 | ||||
-rw-r--r-- | lib/Support/SourceMgr.cpp | 3 | ||||
-rw-r--r-- | lib/Support/StringRef.cpp | 1 | ||||
-rw-r--r-- | lib/Support/Timer.cpp | 1 | ||||
-rw-r--r-- | lib/Support/Windows/Program.inc | 3 | ||||
-rw-r--r-- | lib/Support/YAMLParser.cpp | 14 |
9 files changed, 17 insertions, 28 deletions
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index deb5c3983d..b3c2614ec9 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -18,7 +18,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringMap.h" @@ -620,7 +619,7 @@ void cl::TokenizeWindowsCommandLine(StringRef Src, StringSaver &Saver, static bool ExpandResponseFile(const char *FName, StringSaver &Saver, TokenizerCallback Tokenizer, SmallVectorImpl<const char *> &NewArgv) { - OwningPtr<MemoryBuffer> MemBuf; + std::unique_ptr<MemoryBuffer> MemBuf; if (MemoryBuffer::getFile(FName, MemBuf)) return false; StringRef Str(MemBuf->getBufferStart(), MemBuf->getBufferSize()); diff --git a/lib/Support/Compression.cpp b/lib/Support/Compression.cpp index b5ddb7002c..5e5336144a 100644 --- a/lib/Support/Compression.cpp +++ b/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; } diff --git a/lib/Support/FileUtilities.cpp b/lib/Support/FileUtilities.cpp index 7f5d540487..b2dc47dc69 100644 --- a/lib/Support/FileUtilities.cpp +++ b/lib/Support/FileUtilities.cpp @@ -13,7 +13,6 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/FileUtilities.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" @@ -177,13 +176,13 @@ int llvm::DiffFilesWithTolerance(StringRef NameA, std::string *Error) { // Now its safe to mmap the files into memory because both files // have a non-zero size. - OwningPtr<MemoryBuffer> F1; + std::unique_ptr<MemoryBuffer> F1; if (error_code ec = MemoryBuffer::getFile(NameA, F1)) { if (Error) *Error = ec.message(); return 2; } - OwningPtr<MemoryBuffer> F2; + std::unique_ptr<MemoryBuffer> F2; if (error_code ec = MemoryBuffer::getFile(NameB, F2)) { if (Error) *Error = ec.message(); diff --git a/lib/Support/LockFileManager.cpp b/lib/Support/LockFileManager.cpp index 3e23298e4f..61afb79fb2 100644 --- a/lib/Support/LockFileManager.cpp +++ b/lib/Support/LockFileManager.cpp @@ -36,7 +36,7 @@ LockFileManager::readLockFile(StringRef LockFileName) { // Read the owning host and PID out of the lock file. If it appears that the // owning process is dead, the lock file is invalid. - OwningPtr<MemoryBuffer> MB; + std::unique_ptr<MemoryBuffer> MB; if (MemoryBuffer::getFile(LockFileName, MB)) return None; diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index f9aef6dba6..4bfd96abe5 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -14,7 +14,6 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/SourceMgr.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/Locale.h" @@ -55,7 +54,7 @@ SourceMgr::~SourceMgr() { size_t SourceMgr::AddIncludeFile(const std::string &Filename, SMLoc IncludeLoc, std::string &IncludedFile) { - OwningPtr<MemoryBuffer> NewBuf; + std::unique_ptr<MemoryBuffer> NewBuf; IncludedFile = Filename; MemoryBuffer::getFile(IncludedFile.c_str(), NewBuf); diff --git a/lib/Support/StringRef.cpp b/lib/Support/StringRef.cpp index bfae754362..bd2a37bb5e 100644 --- a/lib/Support/StringRef.cpp +++ b/lib/Support/StringRef.cpp @@ -10,7 +10,6 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/Hashing.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/edit_distance.h" #include <bitset> diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp index 0456f5d638..7cf4d372a5 100644 --- a/lib/Support/Timer.cpp +++ b/lib/Support/Timer.cpp @@ -12,7 +12,6 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/Timer.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/StringMap.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" diff --git a/lib/Support/Windows/Program.inc b/lib/Support/Windows/Program.inc index 1b777084c7..5827c105af 100644 --- a/lib/Support/Windows/Program.inc +++ b/lib/Support/Windows/Program.inc @@ -12,7 +12,6 @@ //===----------------------------------------------------------------------===// #include "WindowsSupport.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/Support/FileSystem.h" #include <cstdio> #include <fcntl.h> @@ -187,7 +186,7 @@ static bool Execute(ProcessInfo &PI, StringRef Program, const char **args, } // Now build the command line. - OwningArrayPtr<char> command(new char[len+1]); + std::unique_ptr<char[]> command(new char[len+1]); char *p = command.get(); for (unsigned i = 0; args[i]; i++) { diff --git a/lib/Support/YAMLParser.cpp b/lib/Support/YAMLParser.cpp index c3d1ff1b9e..acfc22c180 100644 --- a/lib/Support/YAMLParser.cpp +++ b/lib/Support/YAMLParser.cpp @@ -1561,12 +1561,10 @@ bool Scanner::fetchMoreTokens() { } Stream::Stream(StringRef Input, SourceMgr &SM) - : scanner(new Scanner(Input, SM)) - , CurrentDoc(0) {} + : scanner(new Scanner(Input, SM)), CurrentDoc() {} Stream::Stream(MemoryBuffer *InputBuffer, SourceMgr &SM) - : scanner(new Scanner(InputBuffer, SM)) - , CurrentDoc(0) {} + : scanner(new Scanner(InputBuffer, SM)), CurrentDoc() {} Stream::~Stream() {} @@ -1601,11 +1599,9 @@ void Stream::skip() { i->skip(); } -Node::Node(unsigned int Type, OwningPtr<Document> &D, StringRef A, StringRef T) - : Doc(D) - , TypeID(Type) - , Anchor(A) - , Tag(T) { +Node::Node(unsigned int Type, std::unique_ptr<Document> &D, StringRef A, + StringRef T) + : Doc(D), TypeID(Type), Anchor(A), Tag(T) { SMLoc Start = SMLoc::getFromPointer(peekNext().Range.begin()); SourceRange = SMRange(Start, Start); } |