aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2025-07-25 15:55:21 -0700
committerGitHub <noreply@github.com>2025-07-25 15:55:21 -0700
commitcf6a4bbc42c7e54bf6e251206134b207e757b604 (patch)
tree2f03b5614fbb26d189c6a68274b4f48d0fcac931 /lldb/source/Interpreter
parent67b519577ee6b3743c6c03c6230991cede5648a5 (diff)
downloadllvm-cf6a4bbc42c7e54bf6e251206134b207e757b604.zip
llvm-cf6a4bbc42c7e54bf6e251206134b207e757b604.tar.gz
llvm-cf6a4bbc42c7e54bf6e251206134b207e757b604.tar.bz2
[lldb] Use std::make_shared where possible (NFC) (#150714)
This is a continuation of 68fd102, which did the same thing but only for StopInfo. Using make_shared is both safer and more efficient: - With make_shared, the object and the control block are allocated together, which is more efficient. - With make_shared, the enable_shared_from_this base class is properly linked to the control block before the constructor finishes, so shared_from_this() will be safe to use (though still not recommended during construction).
Diffstat (limited to 'lldb/source/Interpreter')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index da545f1..a0080cf 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -135,8 +135,7 @@ CommandInterpreter::CommandInterpreter(Debugger &debugger,
bool synchronous_execution)
: Broadcaster(debugger.GetBroadcasterManager(),
CommandInterpreter::GetStaticBroadcasterClass().str()),
- Properties(
- OptionValuePropertiesSP(new OptionValueProperties("interpreter"))),
+ Properties(std::make_shared<OptionValueProperties>("interpreter")),
IOHandlerDelegate(IOHandlerDelegate::Completion::LLDBCommand),
m_debugger(debugger), m_synchronous_execution(true),
m_skip_lldbinit_files(false), m_skip_app_init_files(false),