mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 17:18:24 +08:00
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.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2021-03-26 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* psymtab.c (psymbol_functions::expand_symtabs_matching): Only
|
||||||
|
call make_ignore_params once.
|
||||||
|
|
||||||
2021-03-26 Tom Tromey <tom@tromey.com>
|
2021-03-26 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* psymtab.c (psymbol_functions::expand_symtabs_matching): Remove
|
* psymtab.c (psymbol_functions::expand_symtabs_matching): Remove
|
||||||
|
@ -1306,6 +1306,10 @@ psymbol_functions::expand_symtabs_matching
|
|||||||
for (partial_symtab *ps : require_partial_symbols (objfile))
|
for (partial_symtab *ps : require_partial_symbols (objfile))
|
||||||
ps->searched_flag = PST_NOT_SEARCHED;
|
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 ())
|
for (partial_symtab *ps : m_partial_symtabs->range ())
|
||||||
{
|
{
|
||||||
QUIT;
|
QUIT;
|
||||||
@ -1335,7 +1339,7 @@ psymbol_functions::expand_symtabs_matching
|
|||||||
|
|
||||||
if ((symbol_matcher == NULL && lookup_name == NULL)
|
if ((symbol_matcher == NULL && lookup_name == NULL)
|
||||||
|| recursively_search_psymtabs (ps, objfile, domain,
|
|| recursively_search_psymtabs (ps, objfile, domain,
|
||||||
lookup_name->make_ignore_params (),
|
*psym_lookup_name,
|
||||||
symbol_matcher))
|
symbol_matcher))
|
||||||
{
|
{
|
||||||
struct compunit_symtab *symtab =
|
struct compunit_symtab *symtab =
|
||||||
|
Reference in New Issue
Block a user