[Lldb-commits] [PATCH] D57990: Use std::make_shared in LLDB (NFC)

Tatyana Krasnukha via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 11 07:40:54 PST 2019


tatyana-krasnukha added a comment.

These also don't relate directly but intersect with your changes:



================
Comment at: lldb/source/API/SBTypeEnumMember.cpp:78
 TypeEnumMemberImpl &SBTypeEnumMember::ref() {
   if (m_opaque_sp.get() == NULL)
+    m_opaque_sp = std::make_shared<TypeEnumMemberImpl>();
----------------
```
if (!m_opaque_sp)
```


================
Comment at: lldb/source/Core/IOHandler.cpp:1012
       subwindow_sp->m_is_subwin = false;
     }
     subwindow_sp->m_parent = this;
----------------
Also may be simplified
```
    auto get_window = [this, &bounds] () {
      return m_window ?
          ::subwin(m_window, bounds.size.height, bounds.size.width,
                       bounds.origin.y, bounds.origin.x) :
          ::newwin(bounds.size.height, bounds.size.width,
                       bounds.origin.y, bounds.origin.x);
    };

    subwindow_sp = std::make_shared<Window>(name, get_window(), true);
    subwindow_sp->m_is_subwin = m_window.operator bool();
```


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57990/new/

https://reviews.llvm.org/D57990





More information about the lldb-commits mailing list