From ab959a2e68a0c40abb9f69adefb33e1306022333 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 17 Mar 2011 22:18:42 +0000 Subject: Use RequiresNullTerminator to create buffers without a null terminator instead of copying. llvm-svn: 127835 --- llvm/lib/Support/MemoryBuffer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Support/MemoryBuffer.cpp') diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp index 2be0460149a..63a1c54a40f 100644 --- a/llvm/lib/Support/MemoryBuffer.cpp +++ b/llvm/lib/Support/MemoryBuffer.cpp @@ -92,8 +92,10 @@ public: /// getMemBuffer - Open the specified memory range as a MemoryBuffer. Note /// that EndPtr[0] must be a null byte and be accessible! MemoryBuffer *MemoryBuffer::getMemBuffer(StringRef InputData, - StringRef BufferName) { - return GetNamedBuffer(InputData, BufferName, true); + StringRef BufferName, + bool RequiresNullTerminator) { + return GetNamedBuffer(InputData, BufferName, + RequiresNullTerminator); } /// getMemBufferCopy - Open the specified memory range as a MemoryBuffer, -- cgit v1.2.3