]> sourceware.org Git - libabigail.git/commit
Don't consider changes to basic types as being redundant
authorDodji Seketeli <dodji@redhat.com>
Wed, 10 May 2017 07:03:15 +0000 (09:03 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 10 May 2017 09:44:17 +0000 (11:44 +0200)
commit57fafc18523712687fb34ae26a5be042df4715ac
tree8770fa8f0b1244c75de7531c25e293b28eef3a5c
parente1fd8c095ed235e0b99513b079c4b3392b81cde8
Don't consider changes to basic types as being redundant

Suppose we have two types struct A and struct B.  Suppose the two
types have members of integer type.  Suppose there are members of
integer type in struct A that are modified to become members of char
type.  Suppose, at last, that we also have members of integer type in
struct B that are modified to become members of char type.

In that case, we want to see all the changes of members which types
got changed from integer type to char type.  None of these changes
should be considered redundant.

Today, unfortunately, only the first change is reported by default.
The subsequent changes are considered to be redundant.

This patch fixes that by considering that changes that modifies the type of a
decl from a basic type into another are never considered redundant.

* include/abg-comparison.h (is_diff_of_basic_type)
(has_basic_type_change_only): Declare these functions ...
* src/abg-comparison.cc (is_diff_of_basic_type)
(has_basic_type_change_only): ... and define them.
(redundancy_marking_visitor::visit_begin): Use the new
has_basic_type_change_only.
* tests/data/test-diff-filter/libtest37-v0.so: New binary test input.
* tests/data/test-diff-filter/libtest37-v1.so: Likewise.
* tests/data/test-diff-filter/test37-report-0.txt: New test
reference output.
* tests/data/test-diff-filter/test37-v0.cc: Source code of the new
binary test input.
* tests/data/test-diff-filter/test37-v1.cc: Likewise.
* tests/data/Makefile.am: Update to add the new test material to
the source distribution.
* tests/test-diff-filter.cc (in_out_spec): Add the new test input
to this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-comparison.h
src/abg-comparison.cc
tests/data/Makefile.am
tests/data/test-diff-filter/libtest37-v0.so [new file with mode: 0755]
tests/data/test-diff-filter/libtest37-v1.so [new file with mode: 0755]
tests/data/test-diff-filter/test37-report-0.txt [new file with mode: 0644]
tests/data/test-diff-filter/test37-v0.cc [new file with mode: 0644]
tests/data/test-diff-filter/test37-v1.cc [new file with mode: 0644]
tests/test-diff-filter.cc
This page took 0.0305 seconds and 5 git commands to generate.