[lldb/DWARF] Delete some dead code in SymbolFileDWARF

- m_debug_loc(lists) are unused since the relevant logic was moved to
  DWARFContext.
- const versions of DebugInfo(), DebugAbbrev() are not used, and they
  are dangerous to use as they do not initialize the relevant objects.
This commit is contained in:
Pavel Labath 2020-01-31 14:45:35 +01:00
parent fd09f12f32
commit 877963a35a
2 changed files with 2 additions and 38 deletions

View File

@ -406,9 +406,8 @@ SymbolFileDWARF::SymbolFileDWARF(ObjectFileSP objfile_sp,
// contain the .o file index/ID
m_debug_map_module_wp(), m_debug_map_symfile(nullptr),
m_context(m_objfile_sp->GetModule()->GetSectionList(), dwo_section_list),
m_data_debug_loc(), m_abbr(), m_info(), m_fetched_external_modules(false),
m_supports_DW_AT_APPLE_objc_complete_type(eLazyBoolCalculate),
m_unique_ast_type_map() {}
m_fetched_external_modules(false),
m_supports_DW_AT_APPLE_objc_complete_type(eLazyBoolCalculate) {}
SymbolFileDWARF::~SymbolFileDWARF() {}
@ -561,15 +560,6 @@ uint32_t SymbolFileDWARF::CalculateAbilities() {
return abilities;
}
const DWARFDataExtractor &
SymbolFileDWARF::GetCachedSectionData(lldb::SectionType sect_type,
DWARFDataSegment &data_segment) {
llvm::call_once(data_segment.m_flag, [this, sect_type, &data_segment] {
this->LoadSectionData(sect_type, std::ref(data_segment.m_data));
});
return data_segment.m_data;
}
void SymbolFileDWARF::LoadSectionData(lldb::SectionType sect_type,
DWARFDataExtractor &data) {
ModuleSP module_sp(m_objfile_sp->GetModule());
@ -606,10 +596,6 @@ DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() {
return m_abbr.get();
}
const DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() const {
return m_abbr.get();
}
DWARFDebugInfo *SymbolFileDWARF::DebugInfo() {
if (m_info == nullptr) {
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
@ -621,10 +607,6 @@ DWARFDebugInfo *SymbolFileDWARF::DebugInfo() {
return m_info.get();
}
const DWARFDebugInfo *SymbolFileDWARF::DebugInfo() const {
return m_info.get();
}
DWARFUnit *
SymbolFileDWARF::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) {
if (!comp_unit)

View File

@ -222,12 +222,8 @@ public:
DWARFDebugAbbrev *DebugAbbrev();
const DWARFDebugAbbrev *DebugAbbrev() const;
DWARFDebugInfo *DebugInfo();
const DWARFDebugInfo *DebugInfo() const;
DWARFDebugRanges *GetDebugRanges();
static bool SupportedVersion(uint16_t version);
@ -316,17 +312,8 @@ protected:
typedef llvm::DenseMap<lldb::opaque_compiler_type_t, lldb::user_id_t>
ClangTypeToDIE;
struct DWARFDataSegment {
llvm::once_flag m_flag;
lldb_private::DWARFDataExtractor m_data;
};
DISALLOW_COPY_AND_ASSIGN(SymbolFileDWARF);
const lldb_private::DWARFDataExtractor &
GetCachedSectionData(lldb::SectionType sect_type,
DWARFDataSegment &data_segment);
virtual void LoadSectionData(lldb::SectionType sect_type,
lldb_private::DWARFDataExtractor &data);
@ -483,11 +470,6 @@ protected:
lldb_private::DWARFContext m_context;
DWARFDataSegment m_data_debug_loc;
DWARFDataSegment m_data_debug_loclists;
// The unique pointer items below are generated on demand if and when someone
// accesses them through a non const version of this class.
std::unique_ptr<DWARFDebugAbbrev> m_abbr;
std::unique_ptr<DWARFDebugInfo> m_info;
std::unique_ptr<GlobalVariableMap> m_global_aranges_up;