diff options
author | Chris Lattner <sabre@nondot.org> | 2007-10-09 21:46:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-10-09 21:46:38 +0000 |
commit | 3daae2701b76293c31c1cbdafc9782352321e1f0 (patch) | |
tree | f14401f6e7b56d1744a0a1cfbf421ab90d6681f4 /include/llvm/Support/MemoryBuffer.h | |
parent | ec1f94423034014d4cc63d30aecdca7e30342fe8 (diff) | |
download | external_llvm-3daae2701b76293c31c1cbdafc9782352321e1f0.zip external_llvm-3daae2701b76293c31c1cbdafc9782352321e1f0.tar.gz external_llvm-3daae2701b76293c31c1cbdafc9782352321e1f0.tar.bz2 |
Add new MemoryBuffer::getMemBufferCopy method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42815 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/MemoryBuffer.h')
-rw-r--r-- | include/llvm/Support/MemoryBuffer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h index 1e3a154..aa13bfc 100644 --- a/include/llvm/Support/MemoryBuffer.h +++ b/include/llvm/Support/MemoryBuffer.h @@ -61,6 +61,12 @@ public: static MemoryBuffer *getMemBuffer(const char *StartPtr, const char *EndPtr, const char *BufferName = ""); + /// getMemBufferCopy - Open the specified memory range as a MemoryBuffer, + /// copying the contents and taking ownership of it. This has no requirements + /// on EndPtr[0]. + static MemoryBuffer *getMemBufferCopy(const char *StartPtr,const char *EndPtr, + const char *BufferName = ""); + /// getNewMemBuffer - Allocate a new MemoryBuffer of the specified size that /// is completely initialized to zeros. Note that the caller should /// initialize the memory allocated by this method. The memory is owned by |