From c156427ded1dfa7686c90cc56ad16013a079a742 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 16 Nov 2016 21:15:24 +0000 Subject: 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 --- .../Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index d4485cc001e..3747b2b86d5 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -1438,7 +1438,7 @@ bool ScriptInterpreterPython::GenerateTypeSynthClass(StringList &user_input, // Create the function name & definition string. sstr.Printf("class %s:", auto_generated_class_name.c_str()); - auto_generated_class.AppendString(sstr.GetData()); + auto_generated_class.AppendString(sstr.GetString()); // Wrap everything up inside the class, increasing the indentation. // we don't need to play any fancy indentation tricks here because there is no @@ -1446,7 +1446,7 @@ bool ScriptInterpreterPython::GenerateTypeSynthClass(StringList &user_input, for (int i = 0; i < num_lines; ++i) { sstr.Clear(); sstr.Printf(" %s", user_input.GetStringAtIndex(i)); - auto_generated_class.AppendString(sstr.GetData()); + auto_generated_class.AppendString(sstr.GetString()); } // Verify that the results are valid Python. @@ -2873,7 +2873,7 @@ bool ScriptInterpreterPython::GetDocumentationForItem(const char *item, StreamString str_stream; str_stream.Printf( "Function %s was not found. Containing module might be missing.", item); - dest.assign(str_stream.GetData()); + dest = str_stream.GetString(); return false; } } -- cgit v1.2.3