From 516ba158b6890bbcca71527ae0719de151b9de5f Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 17 Feb 2020 10:24:19 +0100 Subject: [PATCH] [lldb] [nfc] Simplify user_id_t -> size_t As discussed in https://reviews.llvm.org/D73206#1871895> simplifying usage of `user_id_t`. There is even written: // The compile unit ID is the index of the DWARF unit. DWARFUnit *dwarf_cu = info->GetUnitAtIndex(comp_unit->GetID()); Differential Revision: https://reviews.llvm.org/D74670 --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp | 2 +- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp index 4cb27e9..8ca1a8f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -109,7 +109,7 @@ size_t DWARFDebugInfo::GetNumUnits() { return m_units.size(); } -DWARFUnit *DWARFDebugInfo::GetUnitAtIndex(user_id_t idx) { +DWARFUnit *DWARFDebugInfo::GetUnitAtIndex(size_t idx) { DWARFUnit *cu = nullptr; if (idx < GetNumUnits()) cu = m_units[idx].get(); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h index 056cf33..db6a0f8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h @@ -35,7 +35,7 @@ public: lldb_private::DWARFContext &context); size_t GetNumUnits(); - DWARFUnit *GetUnitAtIndex(lldb::user_id_t idx); + DWARFUnit *GetUnitAtIndex(size_t idx); DWARFUnit *GetUnitAtOffset(DIERef::Section section, dw_offset_t cu_offset, uint32_t *idx_ptr = nullptr); DWARFUnit *GetUnitContainingDIEOffset(DIERef::Section section, -- 2.7.4