[Lldb-commits] [PATCH] D61481: [DWARF] Reimplement/simplify DWARFUnit::GetID
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri May 3 02:05:05 PDT 2019
labath created this revision.
labath added reviewers: JDevlieghere, clayborg, aprantl.
Herald added subscribers: jdoerfert, arphaman.
The implementation of GetID used a relatively complicated algorithm,
which returned some kind of an offset of the unit in some file
(depending on the debug info flavour). The only thing this ID was used
for was to enable subseqent retrieval of the unit from the SymbolFile.
This can be made simpler if we just make the "ID" of the unit an index
into the list of the units belonging to the symbol file. We already
support indexed access to the units, so each unit already has a well
"index" -- this just makes it accessible from within the unit.
To make the distincion between "id" and "offset" clearer (and help catch
any misuses), I also rename DWARFDebugInfo::GetCompileUnit (which
accesses by offset) into DWARFDebugInfo::GetCompileUnitAtOffset.
On its own, this only brings a minor simplification, but it enables
further simplifications in the DIERef class (coming in a follow-up
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 8679 bytes
Desc: not available
More information about the lldb-commits