diff options
author | Zachary Turner <zturner@google.com> | 2016-11-16 21:15:24 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-11-16 21:15:24 +0000 |
commit | c156427ded1dfa7686c90cc56ad16013a079a742 (patch) | |
tree | f4912beeebd9e7a04e9c20a8e05d64e25bde192d /lldb/source/Core/Module.cpp | |
parent | 725dc14bb21da8a01709a6b3370a658d071689dc (diff) | |
download | bcm5719-llvm-c156427ded1dfa7686c90cc56ad16013a079a742.tar.gz bcm5719-llvm-c156427ded1dfa7686c90cc56ad16013a079a742.zip |
Don't allow direct access to StreamString's internal buffer.
This is a large API change that removes the two functions from
StreamString that return a std::string& and a const std::string&,
and instead provide one function which returns a StringRef.
Direct access to the underlying buffer violates the concept of
a "stream" which is intended to provide forward only access,
and makes porting to llvm::raw_ostream more difficult in the
future.
Differential Revision: https://reviews.llvm.org/D26698
llvm-svn: 287152
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r-- | lldb/source/Core/Module.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 9ce03d6d4de..220773b5ad4 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -316,7 +316,7 @@ ObjectFile *Module::GetMemoryObjectFile(const lldb::ProcessSP &process_sp, if (m_objfile_sp) { StreamString s; s.Printf("0x%16.16" PRIx64, header_addr); - m_object_name.SetCString(s.GetData()); + m_object_name.SetString(s.GetString()); // Once we get the object file, update our module with the object // file's @@ -1118,7 +1118,7 @@ void Module::ReportError(const char *format, ...) { if (last_char != '\n' || last_char != '\r') strm.EOL(); } - Host::SystemLog(Host::eSystemLogError, "%s", strm.GetString().c_str()); + Host::SystemLog(Host::eSystemLogError, "%s", strm.GetData()); } } @@ -1152,7 +1152,7 @@ void Module::ReportErrorIfModifyDetected(const char *format, ...) { } strm.PutCString("The debug session should be aborted as the original " "debug information has been overwritten.\n"); - Host::SystemLog(Host::eSystemLogError, "%s", strm.GetString().c_str()); + Host::SystemLog(Host::eSystemLogError, "%s", strm.GetData()); } } } @@ -1176,7 +1176,7 @@ void Module::ReportWarning(const char *format, ...) { if (last_char != '\n' || last_char != '\r') strm.EOL(); } - Host::SystemLog(Host::eSystemLogWarning, "%s", strm.GetString().c_str()); + Host::SystemLog(Host::eSystemLogWarning, "%s", strm.GetData()); } } @@ -1189,7 +1189,7 @@ void Module::LogMessage(Log *log, const char *format, ...) { va_start(args, format); log_message.PrintfVarArg(format, args); va_end(args); - log->PutCString(log_message.GetString().c_str()); + log->PutCString(log_message.GetData()); } } @@ -1208,7 +1208,7 @@ void Module::LogMessageVerboseBacktrace(Log *log, const char *format, ...) { llvm::sys::PrintStackTrace(stream); log_message.PutCString(back_trace); } - log->PutCString(log_message.GetString().c_str()); + log->PutCString(log_message.GetData()); } } |