Merge branch 'addmainunit3-altlink' into addmainunit3-altlink-sharedstmt
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 16 Jan 2021 07:03:10 +0000 (08:03 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 16 Jan 2021 07:03:10 +0000 (08:03 +0100)
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

index 3f3b548..7b473a5 100644 (file)
@@ -920,15 +920,14 @@ FileSpec SymbolFileDWARF::GetFile(DWARFUnit &unit, size_t file_idx) {
     return FileSpec();
   }
 
-  auto &tu = llvm::cast<DWARFTypeUnit>(unit);
-  return GetTypeUnitSupportFiles(tu).GetFileSpecAtIndex(file_idx);
+  return GetSharedUnitSupportFiles(unit).GetFileSpecAtIndex(file_idx);
 }
 
 const FileSpecList &
-SymbolFileDWARF::GetTypeUnitSupportFiles(DWARFTypeUnit &tu) {
+SymbolFileDWARF::GetSharedUnitSupportFiles(DWARFUnit &unit) {
   static FileSpecList empty_list;
 
-  dw_offset_t offset = tu.GetLineTableOffset();
+  dw_offset_t offset = unit.GetLineTableOffset();
   if (offset == DW_INVALID_OFFSET ||
       offset == llvm::DenseMapInfo<dw_offset_t>::getEmptyKey() ||
       offset == llvm::DenseMapInfo<dw_offset_t>::getTombstoneKey())
@@ -936,7 +935,7 @@ SymbolFileDWARF::GetTypeUnitSupportFiles(DWARFTypeUnit &tu) {
 
   // Many type units can share a line table, so parse the support file list
   // once, and cache it based on the offset field.
-  auto iter_bool = m_type_unit_support_files.try_emplace(offset);
+  auto iter_bool = m_shared_unit_support_files.try_emplace(offset);
   FileSpecList &list = iter_bool.first->second;
   if (iter_bool.second) {
     uint64_t line_table_offset = offset;
@@ -946,7 +945,7 @@ SymbolFileDWARF::GetTypeUnitSupportFiles(DWARFTypeUnit &tu) {
     auto report = [](llvm::Error error) {
       Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO);
       LLDB_LOG_ERROR(log, std::move(error),
-                     "SymbolFileDWARF::GetTypeUnitSupportFiles failed to parse "
+                     "SymbolFileDWARF::GetSharedUnitSupportFiles failed to parse "
                      "the line table prologue");
     };
     llvm::Error error = prologue.parse(data, &line_table_offset, report, ctx);
@@ -954,7 +953,7 @@ SymbolFileDWARF::GetTypeUnitSupportFiles(DWARFTypeUnit &tu) {
       report(std::move(error));
     } else {
       list = ParseSupportFilesFromPrologue(GetObjectFile()->GetModule(),
-                                           prologue, tu.GetPathStyle());
+                                           prologue, unit.GetPathStyle());
     }
   }
   return list;
index 6545ab6..28d4ba1 100644 (file)
@@ -499,7 +499,7 @@ protected:
 
   void FindDwpSymbolFile();
 
-  const lldb_private::FileSpecList &GetTypeUnitSupportFiles(DWARFTypeUnit &tu);
+  const lldb_private::FileSpecList &GetSharedUnitSupportFiles(DWARFUnit &tu);
 
   lldb::ModuleWP m_debug_map_module_wp;
   SymbolFileDWARFDebugMap *m_debug_map_symfile;
@@ -534,7 +534,7 @@ protected:
   DIEToClangType m_forward_decl_die_to_clang_type;
   ClangTypeToDIE m_forward_decl_clang_type_to_die;
   llvm::DenseMap<dw_offset_t, lldb_private::FileSpecList>
-      m_type_unit_support_files;
+      m_shared_unit_support_files;
   std::vector<uint32_t> m_lldb_cu_to_dwarf_unit;
 };