libabigail/include
Dodji Seketeli b041bc9cf0 Fix redundancy propagation on node with filtered local changes
Until now, if a diff node N has a local change, even if all of its
children nodes are redundant, N is not considered as being redundant.
This is an issue if the local changes of N are filtered out; in that
case, N should be considered redundant.

This patch fixes that.  It introduces a second category bitmap on the
diff node that stores the categorization of the diff node that does
*NOT* take in account the categories inherited from its children
nodes.  That way, it's possible to know if the *local changes* of a
given node have been filtered out.

	* include/abg-comparison.h (diff::{get_local_category,
	add_to_local_category, add_to_local_and_inherited_categories,
	remove_from_local_category, set_local_category,
	is_filtered_out_wrt_non_inherited_categories,
	has_local_changes_to_be_reported}): Declare new member functions.
	* src/abg-comp-filter.cc ({harmless, harmful}_filter::{visit,
	visit_end}): Update local category too.
	* src/abg-comparison.cc (diff::priv::local_category_): Add new
	data member.
	(diff::priv::priv): Initialize it.
	(diff::priv::is_filtered_out): Add new member function.  This is
	factorized out of diff::is_filtered_out().
	(diff::is_filtered_out): Re-write in terms of
	diff::priv::is_filtered_out().
	(diff::{get_local_category, add_to_local_category,
	add_to_local_and_inherited_categories, remove_from_local_category,
	set_local_category, is_filtered_out_wrt_non_inherited_categories,
	has_local_changes_to_be_reported}): Define new member functions.
	(suppression_categorization_visitor::visit_begin): Update local
	categories too.
	(redundancy_marking_visitor::visit_end): If all of the children
	nodes of the a diff node N are redundant and if N has filtered-out
	local changes, then N is redundant too.
	* tests/data/test-diff-filter/libtest28-redundant-and-filtered-children-nodes-v{1,2}.so:
	New binary test inputs.
	* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-v{0,1}.cc:
	Source code for the binary test inputs above.
	* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-{0,1}.txt:
	New test output references.
	* tests/test-diff-filter.cc (in_out_specs): Add the test inputs
	above to the set of inputs this test harness has to run over.
	* tests/data/Makefile.am: Add the test materials above to the
	source distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-03-18 18:41:52 +01:00
..
abg-comp-filter.h Bug 17649 Avoid endless looping on diff graph with cycles 2015-02-21 15:16:48 +01:00
abg-comparison.h Fix redundancy propagation on node with filtered local changes 2015-03-18 18:41:52 +01:00
abg-config.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-corpus.h Build the set of exported decls directly during DWARF loading 2015-02-24 13:15:10 +01:00
abg-diff-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-dwarf-reader.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-fwd.h Make is_global_scope() return a pointer to the global scope 2015-03-17 12:00:52 +01:00
abg-hash.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-ini.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-ir.h Delay non-complete class type resolution up to end of corpus reading 2015-03-17 10:54:12 +01:00
abg-libxml-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-libzip-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-reader.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-sptr-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-tools-utils.h Expose a new libabigail::tools_utils namespace 2015-01-08 12:28:14 +01:00
abg-traverse.h Canonicalize types either early or late after TU reading 2015-02-18 21:32:37 +01:00
abg-version.h.in Collapse subdir of include to include. 2013-08-14 15:07:18 +02:00
abg-viz-common.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-viz-dot.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-viz-svg.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-writer.h Update copyright years 2015-01-07 17:52:10 +01:00
Makefile.am Expose a new libabigail::tools_utils namespace 2015-01-08 12:28:14 +01:00