libabigail/include
Matthias Maennich 74a2866e4f XML writer: use consistent type pointers for type ids and emission tracking
Insertion uses the canonical type, if available, but look-up did
not. Given that type id insertion and look-up also use canonical
types, it makes sense to adjust the remaining code accordingly.

Neither decl_only_type_is_emitted nor record_decl_only_type_as_emitted
do the check, but very few types end up being recorded this way.

The functions write_class_decl and write_union_decl (but not
write_class_decl_opening_tag and write_union_decl_opening_tag which
can be called in other contexts) resolve declaration-only types to a
definition where possible.

To ensure type ids consistently refer to the same canonical type we
should use canonical types and definitions-of-declarations more
consistently.

This change introduces get_exemplar_type to return the exemplar type
that should be used for type id and emitted checks.  That exemplar
type is the canonical type of a given type, or the canonical type of
the definition-of-declaration-only-type when applicable.

However, it does not also change all the write functions to write out
the exemplar types.

	* include/abg-fwd.h (get_exemplar_type): Declare new function.
	* src/abg-ir.cc (get_exemplar_type): Define new function.
	* src/abg-writer.cc (type_has_existing_id): use get_exemplar_type
	for resolution.
	(get_id_for_type): Likewise.
	(record_type_as_emitted): Likewise.
	(type_is_emitted): Likewise.

Reviewed-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-12-09 18:41:25 +01:00
..
abg-comp-filter.h Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
abg-comparison.h Consistently use std::unique_ptr for private implementations (pimpl) 2021-07-16 11:16:47 +02:00
abg-config.h abg-config.{cc,h}: Misc comment cleanups 2021-11-12 18:31:29 +01:00
abg-corpus.h Add support for the CTF debug format to libabigail. 2021-11-02 12:43:14 +01:00
abg-ctf-reader.h ctf-reader: Make create_read_context return a smart pointer. 2021-11-23 15:25:05 +01:00
abg-cxx-compat.h abg-cxx-compat: add simplified version of std::optional 2021-03-09 10:41:10 +01:00
abg-diff-utils.h Drop unneccessary includes of abg-cxx-compat.h 2020-12-15 09:23:44 +01:00
abg-dwarf-reader.h Move dwarf_reader::status facilities to an abigail::elf_reader namespace 2021-11-15 11:08:53 +01:00
abg-elf-reader-common.h Move dwarf_reader::status facilities to an abigail::elf_reader namespace 2021-11-15 11:08:53 +01:00
abg-fwd.h XML writer: use consistent type pointers for type ids and emission tracking 2021-12-09 18:41:25 +01:00
abg-hash.h Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
abg-ini.h Consistently use std::unique_ptr for private implementations (pimpl) 2021-07-16 11:16:47 +02:00
abg-interned-str.h Consistently use std::unique_ptr for private implementations (pimpl) 2021-07-16 11:16:47 +02:00
abg-ir.h Fixing incorrect symbol 2021-10-19 12:30:50 +02:00
abg-libxml-utils.h reader: Use xmlFirstElementChild and xmlNextElementSibling rather than xml::advance_to_next_sibling_element 2021-05-03 17:15:22 +02:00
abg-reader.h Detect abixml canonical type instability during abidw --debug-abidiff 2021-05-25 12:24:26 +02:00
abg-regex.h Drop unneccessary includes of abg-cxx-compat.h 2020-12-15 09:23:44 +01:00
abg-reporter.h Drop unneccessary includes of abg-cxx-compat.h 2020-12-15 09:23:44 +01:00
abg-sptr-utils.h Drop unneccessary includes of abg-cxx-compat.h 2020-12-15 09:23:44 +01:00
abg-suppression.h suppression: Fix has_data_member_inserted_between = {offset_of(), offset_of()} 2021-12-06 14:39:32 +01:00
abg-tools-utils.h abidw: Add --abixml-version 2021-11-12 18:31:28 +01:00
abg-traverse.h Consistently use std::unique_ptr for private implementations (pimpl) 2021-07-16 11:16:47 +02:00
abg-version.h.in abidw: Add --abixml-version 2021-11-12 18:31:28 +01:00
abg-viz-common.h Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
abg-viz-dot.h Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
abg-viz-svg.h Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
abg-workers.h Consistently use std::unique_ptr for private implementations (pimpl) 2021-07-16 11:16:47 +02:00
abg-writer.h Bug 27236 - Don't forget to emit some referenced types 2021-08-11 17:39:49 +02:00
Makefile.am Move dwarf_reader::status facilities to an abigail::elf_reader namespace 2021-11-15 11:08:53 +01:00