]> sourceware.org Git - libabigail.git/commit
Bug 29857 - dwarf-reader: Resolve decl-only unions
authorDodji Seketeli <dodji@seketeli.org>
Fri, 16 Dec 2022 14:52:14 +0000 (15:52 +0100)
committerDodji Seketeli <dodji@redhat.com>
Mon, 19 Dec 2022 16:52:10 +0000 (17:52 +0100)
commitfc71e519bb2bdae8182fd734d3b247d4b6469202
tree7d519d272c198809b05278597868ddd65d36a59b
parent10dd604e1813a70f0188bcd7492a46263871f33e
Bug 29857 - dwarf-reader: Resolve decl-only unions

When looking at https://sourceware.org/bugzilla/show_bug.cgi?id=29857
I noticed that decl-only unions where not resolved to their definition
union, unlike what is done for classes and enums.

At type canonicalization, a type A defined in a translation unit TU,
that depends on a decl-only union U will compare different from a type
A defined in a translation unit TU', that depends on the definition of
U, even though the types A should be equal.

This patch teaches the decl-only class resolver to also resolve
decl-only unions, as opposed to resolving just decl-only classes.

* include/abg-fwd.h (typedef classes_or_unions_type): Declare new
typedef.
(lookup_union_types): Declare new function.
* src/abg-dwarf-reader.cc (reader::decl_only_classes_map_): Change
the type of this from string_classes_map to
string_classes_or_unions_map.
(reader::declaration_only_classes): Return a
string_classes_or_unions_map, no more a string_classes_map.
(reader::{maybe_schedule_declaration_only_class_for_resolution,
is_decl_only_class_scheduled_for_resolution}): Handle
class_or_union, not just class_decl.  This is a way to make this
handle unions as well as classes.
(get_opaque_version_of_type): Adjust.
* src/abg-ir.cc (lookup_union_types): Define new function.
* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
Adjust.
* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-fwd.h
src/abg-dwarf-reader.cc
src/abg-ir.cc
tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi
tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi
This page took 0.08467 seconds and 5 git commands to generate.