]> sourceware.org Git - libabigail.git/commit
dwarf-reader: Don't consider top-level types as private
authorDodji Seketeli <dodji@redhat.com>
Tue, 28 Jun 2022 10:38:12 +0000 (12:38 +0200)
committerDodji Seketeli <dodji@redhat.com>
Tue, 28 Jun 2022 10:53:26 +0000 (12:53 +0200)
commit7006c5f3c49b92f066a8f415e87b35a5c2afd32c
treec7b6e212a0c17d0677eccc49239d130bff5fea02
parentb9af1f3540391c3884a2140f9df2ca1f2f9369cd
dwarf-reader: Don't consider top-level types as private

By default, the DWARF reader (wrongly) considers that any top-level
decl/type (inside a namespace) that doesn't have the DW_AT_external
attribute is a private decl/type.

It thus considers that function/variable decls that have that
attribute are public decls, and thus, the types they use are also
public.  Which what we want.

But then, it also considers that top-level types (which never have a
DW_AT_external) are not public.  And that causes unwanted side effects
like dropping some classes on the floor.  As a result, some functions
that have those classes as parameter type would end-up being
considered as having no parameter of that type.  Oops.

This patch fixes that by considering that only function and variable
DIEs ought to have the DW_AT_external flag to be considered as public
decls.  Non-anonymous namespace are also considered as public decls.

This should fix the output of the command:

tools/fedabipkgdiff --debug --abipkgdiff build/tools/abipkgdiff --self-compare -a --from fc36 libabigail

* src/abg-dwarf-reader.cc (die_is_public_decl): Only function and
variable decls having the DW_AT_external, as well as non-anonymous
namespaces are considered public decls.  The rest is considered
private.
(build_namespace_decl_and_add_to_ir): If the current namespace is
private (anonymous), then its content is also private.  Otherwise,
use die_is_public_decl to know if its content is public or not.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc
This page took 0.403195 seconds and 5 git commands to generate.