aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBCommandInterpreter.cpp
diff options
context:
space:
mode:
authorAlex Langford <alangford@apple.com>2023-05-26 15:50:26 -0700
committerAlex Langford <alangford@apple.com>2023-06-15 14:57:20 -0700
commite29cc5216a8608b026e390b69022878b2ec3071a (patch)
tree324a71302bb62413b843e223798f27e10134a2d8 /lldb/source/API/SBCommandInterpreter.cpp
parent8fb919a1154a593fdf01e759ece7904afc73f687 (diff)
downloadllvm-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/API/SBCommandInterpreter.cpp')
-rw-r--r--lldb/source/API/SBCommandInterpreter.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp
index 9ea7200..396c0ee 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -155,11 +155,12 @@ bool SBCommandInterpreter::InterruptCommand() {
const char *SBCommandInterpreter::GetIOHandlerControlSequence(char ch) {
LLDB_INSTRUMENT_VA(this, ch);
- return (IsValid()
- ? m_opaque_ptr->GetDebugger()
- .GetTopIOHandlerControlSequence(ch)
- .GetCString()
- : nullptr);
+ if (!IsValid())
+ return nullptr;
+
+ return ConstString(
+ m_opaque_ptr->GetDebugger().GetTopIOHandlerControlSequence(ch))
+ .GetCString();
}
lldb::ReturnStatus