diff options
author | Pavel Labath <labath@google.com> | 2017-12-21 11:27:21 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-12-21 11:27:21 +0000 |
commit | 2a379e0e2730b7209693f587d7039b44c1323453 (patch) | |
tree | 95c1346011fe8b51463a275de58b740c278d374f /include/llvm | |
parent | dacebdf03d99e3ee53035a8faf2a03ced2a36c09 (diff) |
[Support] Remove MemoryBuffer::getNewUninitMemBuffer
There is nothing useful that can be done with a read-only uninitialized
buffer without const_casting its contents to initialize it. A better
solution is to obtain a writable buffer
(WritableMemoryBuffer::getNewUninitMemBuffer), and then convert it to a
read-only buffer after initialization. All callers of this function have
already been updated to do this, so this function is now unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321257 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Support/MemoryBuffer.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h index 921d428b9b2..7b849fdb867 100644 --- a/include/llvm/Support/MemoryBuffer.h +++ b/include/llvm/Support/MemoryBuffer.h @@ -123,15 +123,6 @@ public: static std::unique_ptr<MemoryBuffer> getNewMemBuffer(size_t Size, StringRef BufferName = ""); - /// Allocate a new MemoryBuffer of the specified size that is not initialized. - /// Note that the caller should initialize the memory allocated by this - /// method. The memory is owned by the MemoryBuffer object. - // - // TODO: Remove this and migrate callers to - // WritableMemoryBuffer::getNewUninitMemBuffer - static std::unique_ptr<MemoryBuffer> - getNewUninitMemBuffer(size_t Size, const Twine &BufferName = ""); - /// Read all of stdin into a file buffer, and return it. static ErrorOr<std::unique_ptr<MemoryBuffer>> getSTDIN(); @@ -199,6 +190,9 @@ public: getFileSlice(const Twine &Filename, uint64_t MapSize, uint64_t Offset, bool IsVolatile = false); + /// Allocate a new MemoryBuffer of the specified size that is not initialized. + /// Note that the caller should initialize the memory allocated by this + /// method. The memory is owned by the MemoryBuffer object. static std::unique_ptr<WritableMemoryBuffer> getNewUninitMemBuffer(size_t Size, const Twine &BufferName = ""); |