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.