[llvm] r209103 - Remove last uses of OwningPtr from llvm. As far as I can tell these method versions are not used by lldb, lld, or clang.
Rafael EspĂndola
rafael.espindola at gmail.com
Wed May 21 07:50:57 PDT 2014
awesome!
On 18 May 2014 17:55, Craig Topper <craig.topper at gmail.com> wrote:
> Author: ctopper
> Date: Sun May 18 16:55:38 2014
> New Revision: 209103
>
> URL: http://llvm.org/viewvc/llvm-project?rev=209103&view=rev
> Log:
> Remove last uses of OwningPtr from llvm. As far as I can tell these method versions are not used by lldb, lld, or clang.
>
> Modified:
> llvm/trunk/include/llvm/Object/Archive.h
> llvm/trunk/include/llvm/Support/FileOutputBuffer.h
> llvm/trunk/include/llvm/Support/MemoryBuffer.h
> llvm/trunk/lib/Object/Archive.cpp
> llvm/trunk/lib/Support/FileOutputBuffer.cpp
> llvm/trunk/lib/Support/MemoryBuffer.cpp
>
> Modified: llvm/trunk/include/llvm/Object/Archive.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/Archive.h?rev=209103&r1=209102&r2=209103&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Object/Archive.h (original)
> +++ llvm/trunk/include/llvm/Object/Archive.h Sun May 18 16:55:38 2014
> @@ -89,13 +89,9 @@ public:
> return StringRef(Data.data() + StartOfFile, getSize());
> }
>
> - error_code getMemoryBuffer(OwningPtr<MemoryBuffer> &Result,
> - bool FullPath = false) const;
> error_code getMemoryBuffer(std::unique_ptr<MemoryBuffer> &Result,
> bool FullPath = false) const;
>
> - error_code getAsBinary(OwningPtr<Binary> &Result,
> - LLVMContext *Context = nullptr) const;
> error_code getAsBinary(std::unique_ptr<Binary> &Result,
> LLVMContext *Context = nullptr) const;
> };
>
> Modified: llvm/trunk/include/llvm/Support/FileOutputBuffer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileOutputBuffer.h?rev=209103&r1=209102&r2=209103&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/FileOutputBuffer.h (original)
> +++ llvm/trunk/include/llvm/Support/FileOutputBuffer.h Sun May 18 16:55:38 2014
> @@ -14,7 +14,6 @@
> #ifndef LLVM_SUPPORT_FILEOUTPUTBUFFER_H
> #define LLVM_SUPPORT_FILEOUTPUTBUFFER_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/Support/DataTypes.h"
> @@ -41,9 +40,6 @@ public:
> /// buffer of the specified size. When committed, the buffer will be written
> /// to the file at the specified path.
> static error_code create(StringRef FilePath, size_t Size,
> - OwningPtr<FileOutputBuffer> &Result,
> - unsigned Flags = 0);
> - static error_code create(StringRef FilePath, size_t Size,
> std::unique_ptr<FileOutputBuffer> &Result,
> unsigned Flags = 0);
>
>
> Modified: llvm/trunk/include/llvm/Support/MemoryBuffer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MemoryBuffer.h?rev=209103&r1=209102&r2=209103&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/MemoryBuffer.h (original)
> +++ llvm/trunk/include/llvm/Support/MemoryBuffer.h Sun May 18 16:55:38 2014
> @@ -24,7 +24,6 @@
> namespace llvm {
>
> class error_code;
> -template<class T> class OwningPtr;
>
> /// MemoryBuffer - This interface provides simple read-only access to a block
> /// of memory, and provides simple methods for reading files and standard input
> @@ -71,10 +70,6 @@ public:
> /// \param IsVolatileSize Set to true to indicate that the file size may be
> /// changing, e.g. when libclang tries to parse while the user is
> /// editing/updating the file.
> - static error_code getFile(Twine Filename, OwningPtr<MemoryBuffer> &Result,
> - int64_t FileSize = -1,
> - bool RequiresNullTerminator = true,
> - bool IsVolatileSize = false);
> static error_code getFile(Twine Filename,
> std::unique_ptr<MemoryBuffer> &Result,
> int64_t FileSize = -1,
> @@ -89,10 +84,6 @@ public:
> /// changing, e.g. when libclang tries to parse while the user is
> /// editing/updating the file.
> static error_code getOpenFileSlice(int FD, const char *Filename,
> - OwningPtr<MemoryBuffer> &Result,
> - uint64_t MapSize, int64_t Offset,
> - bool IsVolatileSize = false);
> - static error_code getOpenFileSlice(int FD, const char *Filename,
> std::unique_ptr<MemoryBuffer> &Result,
> uint64_t MapSize, int64_t Offset,
> bool IsVolatileSize = false);
> @@ -104,11 +95,6 @@ public:
> /// changing, e.g. when libclang tries to parse while the user is
> /// editing/updating the file.
> static error_code getOpenFile(int FD, const char *Filename,
> - OwningPtr<MemoryBuffer> &Result,
> - uint64_t FileSize,
> - bool RequiresNullTerminator = true,
> - bool IsVolatileSize = false);
> - static error_code getOpenFile(int FD, const char *Filename,
> std::unique_ptr<MemoryBuffer> &Result,
> uint64_t FileSize,
> bool RequiresNullTerminator = true,
> @@ -141,7 +127,6 @@ public:
>
> /// getSTDIN - Read all of stdin into a file buffer, and return it.
> /// If an error occurs, this returns null and sets ec.
> - static error_code getSTDIN(OwningPtr<MemoryBuffer> &Result);
> static error_code getSTDIN(std::unique_ptr<MemoryBuffer> &Result);
>
>
> @@ -149,9 +134,6 @@ public:
> /// if the Filename is "-". If an error occurs, this returns null and sets
> /// ec.
> static error_code getFileOrSTDIN(StringRef Filename,
> - OwningPtr<MemoryBuffer> &Result,
> - int64_t FileSize = -1);
> - static error_code getFileOrSTDIN(StringRef Filename,
> std::unique_ptr<MemoryBuffer> &Result,
> int64_t FileSize = -1);
>
>
> Modified: llvm/trunk/lib/Object/Archive.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Archive.cpp?rev=209103&r1=209102&r2=209103&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Object/Archive.cpp (original)
> +++ llvm/trunk/lib/Object/Archive.cpp Sun May 18 16:55:38 2014
> @@ -13,7 +13,6 @@
>
> #include "llvm/Object/Archive.h"
> #include "llvm/ADT/APInt.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/ADT/Twine.h"
> #include "llvm/Support/Endian.h"
> @@ -183,14 +182,6 @@ error_code Archive::Child::getMemoryBuff
> return error_code::success();
> }
>
> -error_code Archive::Child::getMemoryBuffer(OwningPtr<MemoryBuffer> &Result,
> - bool FullPath) const {
> - std::unique_ptr<MemoryBuffer> MB;
> - error_code ec = getMemoryBuffer(MB, FullPath);
> - Result = std::move(MB);
> - return ec;
> -}
> -
> error_code Archive::Child::getAsBinary(std::unique_ptr<Binary> &Result,
> LLVMContext *Context) const {
> std::unique_ptr<Binary> ret;
> @@ -204,14 +195,6 @@ error_code Archive::Child::getAsBinary(s
> return object_error::success;
> }
>
> -error_code Archive::Child::getAsBinary(OwningPtr<Binary> &Result,
> - LLVMContext *Context) const {
> - std::unique_ptr<Binary> B;
> - error_code ec = getAsBinary(B, Context);
> - Result = std::move(B);
> - return ec;
> -}
> -
> ErrorOr<Archive*> Archive::create(MemoryBuffer *Source) {
> error_code EC;
> std::unique_ptr<Archive> Ret(new Archive(Source, EC));
>
> Modified: llvm/trunk/lib/Support/FileOutputBuffer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FileOutputBuffer.cpp?rev=209103&r1=209102&r2=209103&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/FileOutputBuffer.cpp (original)
> +++ llvm/trunk/lib/Support/FileOutputBuffer.cpp Sun May 18 16:55:38 2014
> @@ -12,7 +12,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Support/FileOutputBuffer.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallVector.h"
> #include "llvm/Support/raw_ostream.h"
> #include "llvm/Support/system_error.h"
> @@ -85,16 +84,6 @@ error_code FileOutputBuffer::create(Stri
> return error_code::success();
> }
>
> -error_code FileOutputBuffer::create(StringRef FilePath,
> - size_t Size,
> - OwningPtr<FileOutputBuffer> &Result,
> - unsigned Flags) {
> - std::unique_ptr<FileOutputBuffer> FOB;
> - error_code ec = create(FilePath, Size, FOB, Flags);
> - Result = std::move(FOB);
> - return ec;
> -}
> -
> error_code FileOutputBuffer::commit(int64_t NewSmallerSize) {
> // Unmap buffer, letting OS flush dirty pages to file on disk.
> Region.reset(nullptr);
>
> Modified: llvm/trunk/lib/Support/MemoryBuffer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/MemoryBuffer.cpp?rev=209103&r1=209102&r2=209103&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/MemoryBuffer.cpp (original)
> +++ llvm/trunk/lib/Support/MemoryBuffer.cpp Sun May 18 16:55:38 2014
> @@ -12,7 +12,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Support/MemoryBuffer.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/Config/config.h"
> #include "llvm/Support/Errno.h"
> @@ -165,15 +164,6 @@ error_code MemoryBuffer::getFileOrSTDIN(
> return getFile(Filename, Result, FileSize);
> }
>
> -error_code MemoryBuffer::getFileOrSTDIN(StringRef Filename,
> - OwningPtr<MemoryBuffer> &Result,
> - int64_t FileSize) {
> - std::unique_ptr<MemoryBuffer> MB;
> - error_code ec = getFileOrSTDIN(Filename, MB, FileSize);
> - Result = std::move(MB);
> - return ec;
> -}
> -
>
> //===----------------------------------------------------------------------===//
> // MemoryBuffer::getFile implementation.
> @@ -259,18 +249,6 @@ error_code MemoryBuffer::getFile(Twine F
> RequiresNullTerminator, IsVolatileSize);
> }
>
> -error_code MemoryBuffer::getFile(Twine Filename,
> - OwningPtr<MemoryBuffer> &Result,
> - int64_t FileSize,
> - bool RequiresNullTerminator,
> - bool IsVolatileSize) {
> - std::unique_ptr<MemoryBuffer> MB;
> - error_code ec = getFile(Filename, MB, FileSize, RequiresNullTerminator,
> - IsVolatileSize);
> - Result = std::move(MB);
> - return ec;
> -}
> -
> static error_code getOpenFileImpl(int FD, const char *Filename,
> std::unique_ptr<MemoryBuffer> &Result,
> uint64_t FileSize, uint64_t MapSize,
> @@ -437,18 +415,6 @@ error_code MemoryBuffer::getOpenFile(int
> RequiresNullTerminator, IsVolatileSize);
> }
>
> -error_code MemoryBuffer::getOpenFile(int FD, const char *Filename,
> - OwningPtr<MemoryBuffer> &Result,
> - uint64_t FileSize,
> - bool RequiresNullTerminator,
> - bool IsVolatileSize) {
> - std::unique_ptr<MemoryBuffer> MB;
> - error_code ec = getOpenFileImpl(FD, Filename, MB, FileSize, FileSize, 0,
> - RequiresNullTerminator, IsVolatileSize);
> - Result = std::move(MB);
> - return ec;
> -}
> -
> error_code MemoryBuffer::getOpenFileSlice(int FD, const char *Filename,
> std::unique_ptr<MemoryBuffer> &Result,
> uint64_t MapSize, int64_t Offset,
> @@ -457,17 +423,6 @@ error_code MemoryBuffer::getOpenFileSlic
> IsVolatileSize);
> }
>
> -error_code MemoryBuffer::getOpenFileSlice(int FD, const char *Filename,
> - OwningPtr<MemoryBuffer> &Result,
> - uint64_t MapSize, int64_t Offset,
> - bool IsVolatileSize) {
> - std::unique_ptr<MemoryBuffer> MB;
> - error_code ec = getOpenFileImpl(FD, Filename, MB, -1, MapSize, Offset, false,
> - IsVolatileSize);
> - Result = std::move(MB);
> - return ec;
> -}
> -
> //===----------------------------------------------------------------------===//
> // MemoryBuffer::getSTDIN implementation.
> //===----------------------------------------------------------------------===//
> @@ -481,10 +436,3 @@ error_code MemoryBuffer::getSTDIN(std::u
>
> return getMemoryBufferForStream(0, "<stdin>", Result);
> }
> -
> -error_code MemoryBuffer::getSTDIN(OwningPtr<MemoryBuffer> &Result) {
> - std::unique_ptr<MemoryBuffer> MB;
> - error_code ec = getSTDIN(MB);
> - Result = std::move(MB);
> - return ec;
> -}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list