diff options
author | Alex Langford <alangford@apple.com> | 2024-04-24 12:13:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 12:13:18 -0700 |
commit | 57794835279669358ff2828d659eb7133fc0e4bf (patch) | |
tree | cd9c01b0c60c1fcc7052794480b62d2b0220861d /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | 2575cd8a900283368e451cdbc27a2e4db0722af9 (diff) | |
download | llvm-57794835279669358ff2828d659eb7133fc0e4bf.zip llvm-57794835279669358ff2828d659eb7133fc0e4bf.tar.gz llvm-57794835279669358ff2828d659eb7133fc0e4bf.tar.bz2 |
[lldb][nfc] Move broadcaster class strings away from ConstString (#89690)
These are hardcoded strings that are already present in the data section
of the binary, no need to immediately place them in the ConstString
StringPools. Lots of code still calls `GetBroadcasterClass` and places
the return value into a ConstString. Changing that would be a good
follow-up.
Additionally, calls to these functions are still wrapped in ConstStrings
at the SBAPI layer. This is because we must guarantee the lifetime of
all strings handed out publicly.
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 8c3972a..4c58ecc 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -119,15 +119,15 @@ enum { #include "InterpreterPropertiesEnum.inc" }; -ConstString &CommandInterpreter::GetStaticBroadcasterClass() { - static ConstString class_name("lldb.commandInterpreter"); +llvm::StringRef CommandInterpreter::GetStaticBroadcasterClass() { + static constexpr llvm::StringLiteral class_name("lldb.commandInterpreter"); return class_name; } CommandInterpreter::CommandInterpreter(Debugger &debugger, bool synchronous_execution) : Broadcaster(debugger.GetBroadcasterManager(), - CommandInterpreter::GetStaticBroadcasterClass().AsCString()), + CommandInterpreter::GetStaticBroadcasterClass().str()), Properties( OptionValuePropertiesSP(new OptionValueProperties("interpreter"))), IOHandlerDelegate(IOHandlerDelegate::Completion::LLDBCommand), |