From e29cc5216a8608b026e390b69022878b2ec3071a Mon Sep 17 00:00:00 2001 From: Alex Langford Date: Fri, 26 May 2023 15:50:26 -0700 Subject: [lldb][NFCI] Remove use of ConstString from IOHandler None of these need to be in the ConstString StringPool. For the most part they are constant strings and do not require fast comparisons. I did change IOHandlerDelegateMultiline slightly -- specifically, the `m_end_line` member always has a `\n` at the end of it now. This was so that `IOHandlerGetControlSequence` can always return a StringRef. This did require a slight change to `IOHandlerIsInputComplete` where we must drop the newline before comparing it against the input parameter. Differential Revision: https://reviews.llvm.org/D151597 --- .../Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h index b810bdb..fe75f69 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h @@ -434,10 +434,11 @@ public: ~IOHandlerPythonInterpreter() override = default; - ConstString GetControlSequence(char ch) override { + llvm::StringRef GetControlSequence(char ch) override { + static constexpr llvm::StringLiteral control_sequence("quit()\n"); if (ch == 'd') - return ConstString("quit()\n"); - return ConstString(); + return control_sequence; + return {}; } void Run() override { -- cgit v1.1