Fix meaning of "harmless name change" to avoid overfiltering
Whenever a typedef or enum changes its name, we seem to wrongly
qualify that chane as being "harmless" and thus, we tend to filter the
change out, by default. We do this even when e.g, the enum change
also contain other changes that might be meaningful to show.
This commit fixes the issue by "tightening" the qualification of a
harmless name change for typedefs and enums.
For typedefs, a name change is harmless only if there is no change in
the textual representation of the underlying type.
For enums, a name change is harmless only if there is no other change
in the enum, like on the enumerators or on the underlying type of the
enum.
This patch is part of the set of patches whose titles are:
Do not show decl-only-to-def changes in the leaf reporter
Overhaul of the report diff stats summary
Do not mark "distinct" diff nodes as being redundant
Fix meaning of "harmless name change" to avoid overfiltering
Better handle category propagation of pointer changes
Improve function changes reporting in leaf and default mode
Don't filter out typedef changes with redundant underlying type changes
Only show leaf type changes in the leaf type changes section
Fix leaf report of class data member changes
Always show redundant changes in leaf mode
Avoid reporting an enum change if it has already been reported
When we say an a change was reported earlier give its source location
[abipkgdiff]: in leaf mode we always show redundant changes
Update tests for the "better leaf mode redundancy management" patchset
* include/abg-ir.h (enum_has_non_name_change): Declare new
* function. Make it a friend of class enum_type_decl.
* src/abg-comp-filter.cc (has_harmless_name_change): A typedef
name change cannot be harmless if the textual representation of
the underlying type changes too. Also, use the new
enum_has_non_name_change to tighten the harmless name change
definition for an enum.
* src/abg-default-reporter.cc
(default_reporter::report_local_typedef_changes): If the name of
the typedef changed, report it no matter what.
* src/abg-ir.cc (enum_has_non_name_change): Define new function.