diff options
author | Alex Langford <alangford@apple.com> | 2023-05-26 15:50:26 -0700 |
---|---|---|
committer | Alex Langford <alangford@apple.com> | 2023-06-15 14:57:20 -0700 |
commit | e29cc5216a8608b026e390b69022878b2ec3071a (patch) | |
tree | 324a71302bb62413b843e223798f27e10134a2d8 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h | |
parent | 8fb919a1154a593fdf01e759ece7904afc73f687 (diff) | |
download | llvm-e29cc5216a8608b026e390b69022878b2ec3071a.zip llvm-e29cc5216a8608b026e390b69022878b2ec3071a.tar.gz llvm-e29cc5216a8608b026e390b69022878b2ec3071a.tar.bz2 |
[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
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h | 7 |
1 files changed, 4 insertions, 3 deletions
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 { |