diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2025-07-25 15:55:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-25 15:55:21 -0700 |
commit | cf6a4bbc42c7e54bf6e251206134b207e757b604 (patch) | |
tree | 2f03b5614fbb26d189c6a68274b4f48d0fcac931 /lldb/source/Commands/CommandObjectFrame.cpp | |
parent | 67b519577ee6b3743c6c03c6230991cede5648a5 (diff) | |
download | llvm-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/Commands/CommandObjectFrame.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 7e42ef2..5692699 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -901,10 +901,9 @@ void CommandObjectFrameRecognizerAdd::DoExecute(Args &command, StackFrameRecognizerSP(new ScriptedStackFrameRecognizer( interpreter, m_options.m_class_name.c_str())); if (m_options.m_regex) { - auto module = - RegularExpressionSP(new RegularExpression(m_options.m_module)); + auto module = std::make_shared<RegularExpression>(m_options.m_module); auto func = - RegularExpressionSP(new RegularExpression(m_options.m_symbols.front())); + std::make_shared<RegularExpression>(m_options.m_symbols.front()); GetTarget().GetFrameRecognizerManager().AddRecognizer( recognizer_sp, module, func, Mangled::NamePreference::ePreferDemangled, m_options.m_first_instruction_only); |