[Lldb-commits] [PATCH] D73191: Ignore methods in full-name function lookup (with accelerators)

Jaroslav Sevcik via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 22 06:53:05 PST 2020


jarin created this revision.
jarin added a reviewer: labath.
jarin added a project: LLDB.
Herald added subscribers: lldb-commits, arphaman, aprantl.

In the spirit of https://reviews.llvm.org/D70846, we only return non-methods in Apple/DebugNamesDWARFIndex::GetFunction if eFunctionNameTypeFull is requested.

This speeds up lookup in the presence of large amount of methods of the same name (a typical examples would be constructors of templates with many instantiations or overloaded operators).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73191

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
  lldb/test/Shell/SymbolFile/DWARF/find-basic-function.cpp


Index: lldb/test/Shell/SymbolFile/DWARF/find-basic-function.cpp
===================================================================
--- lldb/test/Shell/SymbolFile/DWARF/find-basic-function.cpp
+++ lldb/test/Shell/SymbolFile/DWARF/find-basic-function.cpp
@@ -58,14 +58,11 @@
 // METHOD-DAG: name = "sbar::foo(int)", mangled = "_ZN4sbar3fooEi"
 // METHOD-DAG: name = "ffbar()::sbaz::foo()", mangled = "_ZZ5ffbarvEN4sbaz3fooEv"
 
-// FULL-INDEXED: Found 7 functions:
+// FULL-INDEXED: Found 4 functions:
 // FULL-INDEXED-DAG: name = "foo()", mangled = "_Z3foov"
 // FULL-INDEXED-DAG: name = "foo(int)", mangled = "_Z3fooi"
 // FULL-INDEXED-DAG: name = "bar::foo()", mangled = "_ZN3bar3fooEv"
 // FULL-INDEXED-DAG: name = "bar::baz::foo()", mangled = "_ZN3bar3baz3fooEv"
-// FULL-INDEXED-DAG: name = "sbar::foo()", mangled = "_ZN4sbar3fooEv"
-// FULL-INDEXED-DAG: name = "sbar::foo(int)", mangled = "_ZN4sbar3fooEi"
-// FULL-INDEXED-DAG: name = "ffbar()::sbaz::foo()", mangled = "_ZZ5ffbarvEN4sbaz3fooEv"
 
 // FULL: Found 0 functions:
 
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
@@ -39,8 +39,8 @@
   if (!SymbolFileDWARF::DIEInDeclContext(&parent_decl_ctx, die))
     return;
 
-  // In case of a full match, we just insert everything we find.
-  if (name_type_mask & eFunctionNameTypeFull) {
+  // In case of a full match, we insert all non-methods we find.
+  if (name_type_mask & eFunctionNameTypeFull && !die.IsMethod()) {
     dies.push_back(die);
     return;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73191.239578.patch
Type: text/x-patch
Size: 1665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200122/a35e8c1b/attachment.bin>


More information about the lldb-commits mailing list