aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/MemoryBuffer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-03-17 22:18:42 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-03-17 22:18:42 +0000
commit9916d2ac3941513e301e39dee76a981c7caab694 (patch)
tree0d83c49ddf87b257b95d378dc8df1bb9d61d6706 /lib/Support/MemoryBuffer.cpp
parent813c9a0f19c0d27085a3ea81eb44033747007741 (diff)
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
Diffstat (limited to 'lib/Support/MemoryBuffer.cpp')
-rw-r--r--lib/Support/MemoryBuffer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
index 2be0460149..63a1c54a40 100644
--- a/lib/Support/MemoryBuffer.cpp
+++ b/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<MemoryBufferMem>(InputData, BufferName, true);
+ StringRef BufferName,
+ bool RequiresNullTerminator) {
+ return GetNamedBuffer<MemoryBufferMem>(InputData, BufferName,
+ RequiresNullTerminator);
}
/// getMemBufferCopy - Open the specified memory range as a MemoryBuffer,