summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-16 21:15:24 +0000
committerZachary Turner <zturner@google.com>2016-11-16 21:15:24 +0000
commitc156427ded1dfa7686c90cc56ad16013a079a742 (patch)
treef4912beeebd9e7a04e9c20a8e05d64e25bde192d /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent725dc14bb21da8a01709a6b3370a658d071689dc (diff)
downloadbcm5719-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/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp6
1 files changed, 3 insertions, 3 deletions
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;
}
}
OpenPOWER on IntegriCloud