comparison: Better sort function difference report
Looking at the result of builds on various platforms, it appears that
the order of the method change reports in the
test29-vtable-changes-report-0.txt of runtestdiffdwarf was not stable
across all platforms. debian-armhf was exhibiting this change in
output, for instance:
--- /var/lib/buildbot/workers/wildebeest/libabigail-try-debian-armhf/build/tests/data/test-diff-dwarf/test29-vtable-changes-report-0.txt
2024-03-04 08:56:42.
307366590 +0000
+++ /var/lib/buildbot/workers/wildebeest/libabigail-try-debian-armhf/build/tests/output/test-diff-dwarf/test29-vtable-changes-report-0.txt
2024-03-04 09:20:22.
146334907 +0000
@@ -19,13 +19,13 @@
implicit parameter 0 of type 'S* const' has sub-type
changes:
in unqualified underlying type 'S*':
pointed to type 'struct S' changed, as being reported
+ 'method virtual S::~S(int)' has some sub-type changes:
+ implicit parameter 0 of type 'S*' has sub-type changes:
+ pointed to type 'struct S' changed, as being reported
'method virtual S::~S()' has some sub-type changes:
implicit parameter 0 of type 'S* const' has sub-type
changes:
in unqualified underlying type 'S*':
pointed to type 'struct S' changed, as being reported
- 'method virtual S::~S(int)' has some sub-type changes:
- implicit parameter 0 of type 'S*' has sub-type changes:
- pointed to type 'struct S' changed, as being reported
'method virtual void S::fn0()' has some sub-type changes:
implicit parameter 0 of type 'S*' has sub-type changes:
pointed to type 'struct S' changed, as being reported
Better handling the sorting of function changes should hopefully fix
this issue.
* src/abg-comparison-priv.h (is_less_than): Declare new helper
function.
(function_decl_diff_comp::operator(const function_decl_diff&,
const function_decl_diff&)):
Use it here.
(virtual_member_function_diff_comp::operator(const function_decl_diff&,
const function_decl_diff&)):
Likewise.
* tests/data/test-abidiff/test-PR18791-report0.txt: Adjust.
* tests/data/test-diff-dwarf/test29-vtable-changes-report-0.txt:
Adjust.
* tests/data/test-diff-dwarf/test30-vtable-changes-report-0.txt:
Adjust.
* tests/data/test-diff-dwarf/test31-vtable-changes-report-0.txt:
Adjust.
* tests/data/test-diff-dwarf/test41-PR20476-hidden-report-0.txt:
Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>