]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Lazily compute partial DIE name
authorTom Tromey <tromey@adacore.com>
Wed, 27 May 2020 17:48:18 +0000 (11:48 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 27 May 2020 17:48:19 +0000 (11:48 -0600)
commit7d00ffecd2b16608f0bcfbc0402fec2cc228a3e7
treefa02f48991601aa968c933d16525645bc165520b
parent697bba18273d3a03f9093a94cf3e1d75012905f3
Lazily compute partial DIE name

Currently the name of a partial DIE is computed eagerly.  However, the
name is not always needed.  This patch changes partial DIEs to compute
their name lazily, improving performance by avoiding unnecessary name
computations.

The run previous to this had times of (see the first patch in the
series for an explanation):

gdb    1.88
libxul 2.11
Ada    2.60

This patch improves the times to:

gdb    1.69
libxul 2.02
Ada    2.52

gdb/ChangeLog
2020-05-27  Tom Tromey  <tromey@adacore.com>

* dwarf2/read.c (struct partial_die_info) <name>: Declare new
method.
<canonical_name>: New member.
<raw_name>: Rename from "name".
(partial_die_info): Initialize canonical_name.
(scan_partial_symbols): Check raw_name.
(partial_die_parent_scope, partial_die_full_name)
(add_partial_symbol, add_partial_subprogram)
(add_partial_enumeration, load_partial_dies): Use "name" method.
(partial_die_info::name): New method.
(partial_die_info::read, guess_partial_die_structure_name)
(partial_die_info::fixup): Update.
gdb/ChangeLog
gdb/dwarf2/read.c