[dwarf-reader] Better use of linkage name for fn decl de-duplication
authorDodji Seketeli <dodji@redhat.com>
Thu, 13 Jun 2019 15:56:10 +0000 (17:56 +0200)
committerDodji Seketeli <dodji@redhat.com>
Thu, 13 Jun 2019 16:28:12 +0000 (18:28 +0200)
commit23744b4b8ebb351b1d33041b0f3811b49db9b627
tree9e00a93321f40d8fb5021bdd6fb88195eca29197
parent6149fb02d00d723c6dc99e059a10ea38fb70f928
[dwarf-reader] Better use of linkage name for fn decl de-duplication

When looking at a C program, during function decl DIE de-duplication
at we can rely on linkage names of function declarations to quickly
determine if two function decls are equal, in a given binary.

This patch uses that observation to speed up function decl DIE
de-duplication.  abidw --noout vmlinux goes from 8 to 5 minutes with
this.

* src/abg-dwarf-reader.cc (read_context::{die_is_in_c,
die_is_in_c_or_cplusplus}): Define new member functions.
(fn_die_equal_by_linkage_name): Define new static function.
(compare_dies): In the case for for DW_TAG_subprogram, use the new
fn_die_equal_by_linkage_name.
* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
* tests/data/test-annotate/test21-pr19092.so.abi: Adjust.
* tests/data/test-read-dwarf/test15-pr18892.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/test15-pr18892.so.abi
tests/data/test-annotate/test21-pr19092.so.abi
tests/data/test-read-dwarf/test15-pr18892.so.abi
tests/data/test-read-dwarf/test21-pr19092.so.abi