summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
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
commitab959a2e68a0c40abb9f69adefb33e1306022333 (patch)
tree7bb7def286f6154b2ff17f6d2e9849037dc5b169 /llvm/lib/Support
parentaad34d882d4f478249828fa32e57a288d706ba34 (diff)
downloadbcm5719-llvm-ab959a2e68a0c40abb9f69adefb33e1306022333.tar.gz
bcm5719-llvm-ab959a2e68a0c40abb9f69adefb33e1306022333.zip
Use RequiresNullTerminator to create buffers without a null terminator
instead of copying. llvm-svn: 127835
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/MemoryBuffer.cpp6
1 files changed, 4 insertions, 2 deletions
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<MemoryBufferMem>(InputData, BufferName, true);
+ StringRef BufferName,
+ bool RequiresNullTerminator) {
+ return GetNamedBuffer<MemoryBufferMem>(InputData, BufferName,
+ RequiresNullTerminator);
}
/// getMemBufferCopy - Open the specified memory range as a MemoryBuffer,
OpenPOWER on IntegriCloud