]> sourceware.org Git - libabigail.git/commit
[dwarf-reader] Re-use function types inside a given TU
authorDodji Seketeli <dodji@redhat.com>
Thu, 13 Jun 2019 09:16:53 +0000 (11:16 +0200)
committerDodji Seketeli <dodji@redhat.com>
Thu, 13 Jun 2019 16:28:11 +0000 (18:28 +0200)
commit6149fb02d00d723c6dc99e059a10ea38fb70f928
tree3e8b3c033c78250b8cc1a4579f9d84bcaecc7f30
parent2528644c034f63f4b550f9554545999bc3c3e85e
[dwarf-reader] Re-use function types inside a given TU

Whenever we see a function type inside a translation unit, if it
matches one that has already been seen -- i.e, one that has the same
textual representation -- we should be able to re-use that same
function type without having to compare their types to be sure they
are the same, as part of the type canonicalization process.

This slittly increases analysis speed (by a few tens of seconds on a
total of 8 minutes) by decreasing the load on type canonicalization
when anlyzing vmlinux.  It also slightly reduces memory consumption,
so I am getting it in for now.

* src/abg-dwarf-reader.cc (istring_fn_type_map_type): Declare new
typedef.
(die_is_function_type): Define new static function.
(read_context::per_tu_repr_to_fn_type_maps_): Define new data
member ...
(read_context::per_tu_repr_to_fn_type_maps): ... and its accessor.
(read_context::{associate_die_repr_to_fn_type_per_tu,
lookup_fn_type_from_die_repr_per_tu}): Define new member
functions.
(build_function_type): Use the new
read_context::lookup_fn_type_from_die_repr_per_tu and
read_context::associate_die_repr_to_fn_type_per_tu functions,
instead of read_context::lookup_type_from_die.
* tests/data/test-annotate/test13-pr18894.so.abi: Adjust.
* tests/data/test-annotate/test14-pr18893.so.abi: Adjust.
* tests/data/test-annotate/test21-pr19092.so.abi: Adjust.
* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
* tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust.
* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc
tests/data/test-annotate/test13-pr18894.so.abi
tests/data/test-annotate/test14-pr18893.so.abi
tests/data/test-annotate/test21-pr19092.so.abi
tests/data/test-read-dwarf/test13-pr18894.so.abi
tests/data/test-read-dwarf/test14-pr18893.so.abi
tests/data/test-read-dwarf/test16-pr18904.so.abi
tests/data/test-read-dwarf/test21-pr19092.so.abi
This page took 0.035283 seconds and 5 git commands to generate.