[Lldb-commits] [PATCH] D103442: [lldb][NFC] Remove a redundant call to weak_ptr::expired

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 1 01:58:37 PDT 2021

teemperor created this revision.
teemperor added a reviewer: LLDB.
teemperor added a project: LLDB.
Herald added a subscriber: JDevlieghere.
teemperor requested review of this revision.
Herald added a subscriber: lldb-commits.

The `lock` call directly will check for us if the `weak_ptr` is expired and
returns an invalid `shared_ptr` (which we correctly handle), so this check is redundant.

  rG LLVM Github Monorepo



Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -3792,7 +3792,7 @@
 SymbolFileDWARFDebugMap *SymbolFileDWARF::GetDebugMapSymfile() {
-  if (m_debug_map_symfile == nullptr && !m_debug_map_module_wp.expired()) {
+  if (m_debug_map_symfile == nullptr) {
     lldb::ModuleSP module_sp(m_debug_map_module_wp.lock());
     if (module_sp) {
       m_debug_map_symfile =

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103442.348909.patch
Type: text/x-patch
Size: 577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210601/df032e7a/attachment.bin>

More information about the lldb-commits mailing list