[Lldb-commits] [PATCH] D74637: Separate DIERef vs. user_id_t: m_function_scope_qualified_name_map

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 17 07:37:54 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG217808887918: Separate DIERef vs. user_id_t: m_function_scope_qualified_name_map (authored by jankratochvil).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74637

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h


Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -500,7 +500,7 @@
   bool m_fetched_external_modules : 1;
   lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
 
-  typedef std::set<lldb::user_id_t> DIERefSet;
+  typedef std::set<DIERef> DIERefSet;
   typedef llvm::StringMap<DIERefSet> NameToOffsetMap;
   NameToOffsetMap m_function_scope_qualified_name_map;
   std::unique_ptr<DWARFDebugRanges> m_ranges;
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2381,9 +2381,9 @@
       dwo->GetMangledNamesForFunction(scope_qualified_name, mangled_names);
   }
 
-  for (lldb::user_id_t uid :
+  for (DIERef die_ref :
        m_function_scope_qualified_name_map.lookup(scope_qualified_name)) {
-    DWARFDIE die = GetDIE(uid);
+    DWARFDIE die = GetDIE(die_ref);
     mangled_names.push_back(ConstString(die.GetMangledName()));
   }
 }
@@ -3031,7 +3031,7 @@
                                            .AsCString(""));
       if (scope_qualified_name.size()) {
         m_function_scope_qualified_name_map[scope_qualified_name].insert(
-            die.GetID());
+            *die.GetDIERef());
       }
     }
   }
Index: lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
@@ -44,6 +44,16 @@
 
   dw_offset_t die_offset() const { return m_die_offset; }
 
+  bool operator<(DIERef other) const {
+    if (m_dwo_num_valid != other.m_dwo_num_valid)
+      return m_dwo_num_valid < other.m_dwo_num_valid;
+    if (m_dwo_num_valid && (m_dwo_num != other.m_dwo_num))
+      return m_dwo_num < other.m_dwo_num;
+    if (m_section != other.m_section)
+      return m_section < other.m_section;
+    return m_die_offset < other.m_die_offset;
+  }
+
 private:
   uint32_t m_dwo_num : 30;
   uint32_t m_dwo_num_valid : 1;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74637.244973.patch
Type: text/x-patch
Size: 2297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200217/1dcba2f6/attachment.bin>


More information about the lldb-commits mailing list