summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-10-06 21:22:44 +0000
committerZachary Turner <zturner@google.com>2016-10-06 21:22:44 +0000
commit4fa098a5c0223dab6ae10da6f01541e943cc0bbf (patch)
treef22c6bf0e5f05bc7b0c405fbbb81a7f444a3364f /lldb/source/Core
parent60fb35b20a0fc335e5f626c44006eed3a49d3bd7 (diff)
downloadbcm5719-llvm-4fa098a5c0223dab6ae10da6f01541e943cc0bbf.tar.gz
bcm5719-llvm-4fa098a5c0223dab6ae10da6f01541e943cc0bbf.zip
Convert UniqueCStringMap to use StringRef.
llvm-svn: 283494
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/Stream.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/source/Core/Stream.cpp b/lldb/source/Core/Stream.cpp
index a5eca3f38ea..7614d02742b 100644
--- a/lldb/source/Core/Stream.cpp
+++ b/lldb/source/Core/Stream.cpp
@@ -97,12 +97,14 @@ size_t Stream::PutULEB128(uint64_t uval) {
//------------------------------------------------------------------
// Print a raw NULL terminated C string to the stream.
//------------------------------------------------------------------
-size_t Stream::PutCString(const char *cstr) {
- size_t cstr_len = strlen(cstr);
+size_t Stream::PutCString(llvm::StringRef str) {
+ size_t bytes_written = 0;
+ bytes_written = Write(str.data(), str.size());
+
// when in binary mode, emit the NULL terminator
if (m_flags.Test(eBinary))
- ++cstr_len;
- return Write(cstr, cstr_len);
+ bytes_written += PutChar('\0');
+ return bytes_written;
}
//------------------------------------------------------------------
OpenPOWER on IntegriCloud