Improve DWARF parsing and accessing by 1% to 2%
authorGreg Clayton <clayborg@gmail.com>
Thu, 30 May 2019 15:21:23 +0000 (15:21 +0000)
committerGreg Clayton <clayborg@gmail.com>
Thu, 30 May 2019 15:21:23 +0000 (15:21 +0000)
commit202c3ffcbfda4d2a53d4b8e5c1c9140b321b02da
treeaf1ef5658dde34aa76cf7d1c1b8da0194e15caf6
parentf61b5481fd2ce47c5891e856ab1a2a6e8c0e9538
Improve DWARF parsing and accessing by 1% to 2%

When LLDB first started we didn't have our mmap of the DWARF data done correctly and if the backing file would change we would get live changes as the file changed and it would cause problems. We now mmap correctly and do not run into these issues. There was legacy code in DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(...) that would always extract the abbrev index each time the function was called to verify that DWARF data hadn't changed and a warning was emitted if it did. We no longer need this and the code was removed. The other thing this function did when it parsed the abbrev index was give us the offset of the first attribute bytes by adding the LEB128 size to the offset. This required an extra parameter to DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(...) which is now removed. I added "lldb::offset_t DWARFDebugInfoEntry::GetFirstAttributeOffset() const" which calculates this when we need it and modified all sites that need the offset to call it.

Now that we aren't decoding and verifying the abbrev index, it speeds up DWARF access by 1% to 2%.

Differential Revision: https://reviews.llvm.org/D62634

llvm-svn: 362103
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h