Fix var_diff length determination

* src/abg-comparison.cc (var_diff::length):  Just compare the two
	diff subjects.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2014-03-29 09:04:01 +01:00
parent 9291712259
commit e55a7e3397
6 changed files with 29 additions and 13 deletions

View File

@ -1185,19 +1185,7 @@ var_diff::type_diff() const
/// @return the length of the current diff.
unsigned
var_diff::length() const
{
unsigned l = 0;
var_decl_sptr f = first_var(), s = second_var();
if (f->get_binding() != s->get_binding())
++l;
l += diff_length_of_decl_bases(f, s);
diff_sptr d = compute_diff(f->get_type(), s->get_type(), context());
l += d->length();
return l;
}
{return *first_var() != *second_var();}
/// Report the diff in a serialized form.
///

View File

@ -113,6 +113,11 @@ data/test-diff-dwarf/test0-v0.o \
data/test-diff-dwarf/test0-v1.cc \
data/test-diff-dwarf/test0-v1.o \
data/test-diff-dwarf/test0-report.txt \
data/test-diff-dwarf/test1-v0.cc \
data/test-diff-dwarf/test1-v0.o \
data/test-diff-dwarf/test1-v1.cc \
data/test-diff-dwarf/test1-v1.o \
data/test-diff-dwarf/test1-report.txt \
\
data/test-read-dwarf/test0 \
data/test-read-dwarf/test0.abi \

View File

@ -0,0 +1,17 @@
Functions changes summary: 0 Removed, 1 Changed, 0 Added function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
1 function with some indirect sub-type change:
[C]'function void foo(const S&)' has some indirect sub-type changes:
parameter 0 of type 'const S&' changed:
in unqualified underlying type 'S&':
in referenced type 'struct S':
size changed from 64 to 96 bits
1 data member change:
'int S::m1' offset changed from 32 to 64
1 data member insertion:
'unsigned int S::m01', at offset 32 (in bits)

Binary file not shown.

Binary file not shown.

View File

@ -62,6 +62,12 @@ InOutSpec in_out_specs[] =
"data/test-diff-dwarf/test0-report.txt",
"output/test-diff-dwarf/test0-report.txt"
},
{
"data/test-diff-dwarf/test1-v0.o",
"data/test-diff-dwarf/test1-v1.o",
"data/test-diff-dwarf/test1-report.txt",
"output/test-diff-dwarf/test1-report.txt"
},
// This should be the last entry
{NULL, NULL, NULL, NULL}
};