Fix the output of the array diff report

While working on something else, I realized the report of the array
diff change wasn't referring to the pretty representation of the array
when talking about the changes of array element type; rather it was
just referring to the array name.  I think referring to the pretty
representation of the array is more helpful.  This patch does just
that.

	* src/abg-comparison.cc (array_diff::report): Refer to the pretty
	representation of the array when talking about changes of the
	array element type.
	* src/abg-ir.cc (equals): In the overload for array_type, use the
	equality operator that knows how to handle null pointers to
	element type.  This avoids crashes when the pointer to element
	type is null.
	* tests/data/test-diff-dwarf/test10-report.txt: Adjust.
	* tests/data/test-diff-filter/test24-compatible-vars-report-1.txt:
	Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2015-01-19 14:44:56 +01:00
parent 63c81f028d
commit af0923b1b0
4 changed files with 5 additions and 6 deletions

View File

@ -5135,9 +5135,8 @@ array_diff::report(ostream& out, const string& indent) const
if (d->to_be_reported())
{
// report array element type changes
out << indent << "array element type '"
<< d->first_subject()->get_name()
<< "' changed:\n";
out << indent << "array element type of '"
<< name << "' changed:\n";
d->report(out, indent + " ");
}

View File

@ -4578,7 +4578,7 @@ equals(const array_type_def& l, const array_type_def& r, change_kind& k)
break;
}
if (*l.get_element_type() != *r.get_element_type())
if (l.get_element_type() != r.get_element_type())
{
k |= SUBTYPE_CHANGE_KIND;
result = false;

View File

@ -14,7 +14,7 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
subrange 2 changed length from 3 to 4
'int* S::m1[10]' offset changed from 512 to 640
and its type 'int*[10]' changed:
array element type 'int*' changed:
array element type of 'int*[10]' changed:
in pointed to type 'int':
name changed from 'int' to 'char'
size changed from 32 to 8 bits

View File

@ -4,6 +4,6 @@ Variables changes summary: 0 Removed, 1 Changed, 0 Added variable
1 Changed variable:
'S a[2]' was changed to 'typedef_of_S a[2]':
type of variable changed:
array element type 'S' changed:
array element type of 'S[2]' changed:
entity changed from 'struct S' to compatible type 'typedef typedef_of_S'