[Lldb-commits] [PATCH] D46889: [DWARF] Extract indexing code into a separate class hierarchy
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue May 15 09:22:59 PDT 2018
labath created this revision.
labath added reviewers: clayborg, JDevlieghere.
Herald added subscribers: aprantl, mgorny.
This places the `if(m_using_apple_tables)` branches inside the
SymbolFileDWARF class behind an abstract DWARFIndex class. The class
currently has two implementations:
- AppleIndex, which searches using .apple_names and friends
- ManualIndex, which searches using a manually built index
Most of the methods of the class are very simple, and simply extract the
list of DIEs for the given name from the appropriate sub-table. The main
exception are the two GetFunctions overloads, which take a couple of
extra paramenters, including some callbacks. It was not possible to
split these up the same way as other methods, as here we were doing a
lot of post-processing on the results. The post-processing is similar
for the two cases, but not identical. I hope to factor these further in
Other interesting methods are:
- Preload(): do any preprocessing to make lookups faster (noop for AppleIndex, forces a build of the lookup tables for ManualIndex).
- ReportInvalidDIEOffset(): Used to notify the users of an invalid index (prints a message for AppleIndex, noop for ManualIndex).
- Dump(): dumps the index state (noop for AppleIndex, prints the lookup tables for ManualIndex).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 71230 bytes
Desc: not available
More information about the lldb-commits