[Lldb-commits] [PATCH] D53662: Give the SymbolFile plugin enough information to efficiently do exact match lookups

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 25 10:56:40 PDT 2018


jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

This looks good to me.

Looking at the addition of Type::ConsumeTypeClass makes it really clear that both this function and Type::GetTypeScopeAndBasename need to dispatch to the CompilerSystem to do this work.  The actual code is way too C-family-ish to be in the generic Type.cpp.  That will require passing in a language because I don't think you know enough from just the symfile and name to know which language the user was looking up types for.

But this change doesn't make it harder to get that right, so fixing it doesn't need to be part of this patch.

So far as I can tell, you can't do an O(1) lookup of an exact name in DWARF from the dwarf_names table (or the proceeding apple tables).  The tables are organized by base name (or really whatever in the DW_AT_name attribute of the die).  So you will always have to pull the base name out, find all the base name matches and then run up the parent dies to build up the fully qualified name.  Each name entry has the parent DIE, so building up the full name is pretty efficient.  But still, the best you can do O(number_of_occurances_of_name) and knowing the name is exact doesn't help the search speed.  If I'm right about that (Greg will surely know) then we should remove the FIXME comment in SymbolFileDWARF since it refers to an unfixable fix.


https://reviews.llvm.org/D53662





More information about the lldb-commits mailing list