mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-23 01:06:56 +00:00
Following the changes to represent changed anonymous unreachable enums, this patch does the same for anonymous unreachable unions, classes and structs. Basically, without this patch, this change: union { int a; int b; }; ------ union { int a; int b; int c; }; yields: 1 removed type unreachable from any public interface: [D] 'union {int a; int b;}' at test_1.c:1:1 1 added type unreachable from any public interface: [A] 'union {int a; int b; int c;}' at test_2.c:1:1 But with the patch, it does yield: 1 changed type unreachable from any public interface: [C] 'union {int a; int b;}' changed: type size hasn't changed 1 data member insertion: 'int c' at test-anon-union-v1.c:5:1 type changed from: union {int a; int b;} to: union {int a; int b; int c;} * include/abg-fwd.h (class_or_union_types_of_same_kind) (is_data_member_of_anonymous_class_or_union): Declare new functions. * include/abg-ir.h (lookup_data_member): Likewise, declare a new overload. * src/abg-ir.cc (class_or_union_types_of_same_kind) (lookup_data_member, is_data_member_of_anonymous_class_or_union): Define news functions & overloads. * src/abg-reporter-priv.cc (represent): When representing a change in the name of a data member, if the context is an anonymous type, use the non-qualified name of the data member, not its qualified name. * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): Handle deleted/added anonymous enums, unions, classes and structs similarly. That is, if an anonymous type was removed and another one got added, if they both have data members (or enumerators) in common, then we are probably looking at an anonymous type that was changed. This is because these anonymous types are named using their flat representation. * tests/data/test-abidiff-exit/test-anon-types-report-1.txt: New reference test comparison output. * tests/data/test-abidiff-exit/test-anon-types-v{0,1}.o: New binary tests input files. * tests/data/test-abidiff-exit/test-anon-types-v{0,1}.c: Source code of new binary test input. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-abidiff-exit.cc (in_out_specs): Add the test inputs above to this test harness. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
data | ||
lib | ||
.gitignore | ||
Makefile.am | ||
mockfedabipkgdiff.in | ||
print-diff-tree.cc | ||
runtestcanonicalizetypes.sh.in | ||
runtestdefaultsupprs.py.in | ||
runtestdefaultsupprspy3.sh.in | ||
runtestfedabipkgdiff.py.in | ||
runtestfedabipkgdiffpy3.sh.in | ||
runtestslowselfcompare.sh.in | ||
test-abicompat.cc | ||
test-abidiff-exit.cc | ||
test-abidiff.cc | ||
test-alt-dwarf-file.cc | ||
test-annotate.cc | ||
test-core-diff.cc | ||
test-cxx-compat.cc | ||
test-diff2.cc | ||
test-diff-dwarf-abixml.cc | ||
test-diff-dwarf.cc | ||
test-diff-filter.cc | ||
test-diff-pkg.cc | ||
test-diff-suppr.cc | ||
test-dot.cc | ||
test-elf-helpers.cc | ||
test-ini.cc | ||
test-ir-walker.cc | ||
test-kmi-whitelist.cc | ||
test-lookup-syms.cc | ||
test-read-btf.cc | ||
test-read-common.cc | ||
test-read-common.h | ||
test-read-ctf.cc | ||
test-read-dwarf.cc | ||
test-read-write.cc | ||
test-svg.cc | ||
test-symtab-reader.cc | ||
test-symtab.cc | ||
test-tools-utils.cc | ||
test-types-stability.cc | ||
test-utils.cc | ||
test-utils.h | ||
test-valgrind-suppressions.supp | ||
update-test-output.py |