libabigail/include
Dodji Seketeli 8569491741 Bug 28319 - re-fix of rhbz1951526 - SELF CHECK FAILED for 'gimp-2.10'
This commit re-visit the commit below:

    commit 1cfbff1b30
    Author: Dodji Seketeli <dodji@redhat.com>
    Date:   Mon Jun 7 16:07:50 2021 +0200

	rhbz1951526 - SELF CHECK FAILED for 'gimp-2.10'

	This is a fix for bug https://bugzilla.redhat.com/show_bug.cgi?id=1951526.

Basically, this commits makes is so that two enums below are
considered equal by libabigail:

     enum foo // This is foo #1
     {
       e0 = 0;
       e1 = 1;
       e2 = 2;
     };

     enum foo  // This is foo #2
     {
       e0 = 0;
       e1 = 1;
       e2 = 2;
       e_added = 1; // This enumerator is considered redundant
       	       	    // with the enumerator e1 because their values
		    // are the same.
     };

With this patch, foo #1 and foo #2 are considered equal, just like in
the original commit 1cfbff1b.  In the original commit however, this
was achieved by comparing the enums without considering their
enumerator names.  This was named "binary-only enum comparison".  In
reality, that approach was too big of a hammer and was causing the
issues raised in the bug.  Namely, type canonicalization would
conflate anonymous enums that were unrelated (precisely because their
enumerator names were different), leading to spurious type change
reports when comparing abixml files pre-dating commit 1cfbff1b with
posterior abixml files.

If I refer to the example above with foo #1 and #2, this patch detects
that the value of the enumerator 'e_added' is redundant with the value
of the enumerator e1.  As such, the two foo #1 and #2 are considered
equal.  Enumerator names are now fully taken into account.

With this precise approach, it now seems we can do away with the
careful dance of using "binary-only enum comparison" at some precise
times of the libabigail pipeline.  Now, we can just use the new enum
comparison scheme all the time.  Leading to less (complicated) code
and a hopefully accurate representation.

	* include/abg-ir.h (environment::use_enum_binary_only_equality):
	Remove.
	* src/abg-comparison.cc (compute_diff): In the overload for
	enum_type_decl, stop using binary-only-equality for enums.
	* src/abg-dwarf-reader.cc
	(read_context::compare_before_canonicalisation): Likewise.
	* src/abg-ir.cc (environment::use_enum_binary_only_equality):
	Remove.
	(enumerators_values_are_equal)
	(is_enumerator_value_present_in_enum)
	(is_enumerator_value_redundant): Define new static functions.
	(equals): In the overload for enum_type_decl, use the new
	is_enumerator_value_redundant to detect if two enums are equal
	modulo a redundant enumerator value.  In that case, consider they
	are equal.
	* tests/data/test-abidiff/test-enum0-report.txt: Adjust.
	* tests/data/test-annotate/test-anonymous-members-0.o.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
	* tests/data/test-diff-dwarf/PR25058-liblttng-ctl-report-1.txt: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2022-01-14 10:45:29 +01:00
..
Makefile.am Move dwarf_reader::status facilities to an abigail::elf_reader namespace 2021-11-15 11:08:53 +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 Bug 28319 - re-fix of rhbz1951526 - SELF CHECK FAILED for 'gimp-2.10' 2022-01-14 10:45:29 +01: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