Use RequiresNullTerminator to create buffers without a null terminator

instead of copying.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127835 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2011-03-17 22:18:42 +00:00
parent 813c9a0f19
commit 9916d2ac39
3 changed files with 8 additions and 12 deletions

View File

@ -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<MemoryBufferMem>(InputData, BufferName, true);
StringRef BufferName,
bool RequiresNullTerminator) {
return GetNamedBuffer<MemoryBufferMem>(InputData, BufferName,
RequiresNullTerminator);
}
/// getMemBufferCopy - Open the specified memory range as a MemoryBuffer,