diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-26 13:28:03 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-26 13:28:03 -0600 |
commit | e2cd5ca40c03271aa0bf324cac1f7a66ad3904d8 (patch) | |
tree | ba78d6ae6b8cd50c3fb4932cfd2b817cfccf15ca /gdb/psymtab.c | |
parent | cd43f63e00113cc10e068a10966a8c90e9b37ccc (diff) | |
download | gdb-e2cd5ca40c03271aa0bf324cac1f7a66ad3904d8.zip gdb-e2cd5ca40c03271aa0bf324cac1f7a66ad3904d8.tar.gz gdb-e2cd5ca40c03271aa0bf324cac1f7a66ad3904d8.tar.bz2 |
Simplify psymbol_functions::expand_symtabs_matching
I noticed that psymbol_functions::expand_symtabs_matching calls
make_ignore_params once per psymtab that is matched. This seems
possibly expensive, so this patch hoists the call out of the loop.
gdb/ChangeLog
2021-03-26 Tom Tromey <tom@tromey.com>
* psymtab.c (psymbol_functions::expand_symtabs_matching): Only
call make_ignore_params once.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r-- | gdb/psymtab.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 5a64166..1ea7376 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1306,6 +1306,10 @@ psymbol_functions::expand_symtabs_matching for (partial_symtab *ps : require_partial_symbols (objfile)) ps->searched_flag = PST_NOT_SEARCHED; + gdb::optional<lookup_name_info> psym_lookup_name; + if (lookup_name != nullptr) + psym_lookup_name = lookup_name->make_ignore_params (); + for (partial_symtab *ps : m_partial_symtabs->range ()) { QUIT; @@ -1335,7 +1339,7 @@ psymbol_functions::expand_symtabs_matching if ((symbol_matcher == NULL && lookup_name == NULL) || recursively_search_psymtabs (ps, objfile, domain, - lookup_name->make_ignore_params (), + *psym_lookup_name, symbol_matcher)) { struct compunit_symtab *symtab = |