libabigail/include
Dodji Seketeli 3824d8f3c2 Allow several kinds of reports to be emitted
Right now, the reporting functionnality is implemented directly in the
comparison engine.  Being able to emit several kinds of reports is
really not practical with the current design.

This patch improves that situation by introducing an indirection
between the comparison engine and the code that emits the report.

A new abigail::comparison::reporter_base type is introduced.  That
type several contains virtual methods that knows how to implement
reporting.  Each virtual method reports about changes carried by a
kind of diff node.  In other words, abigail::comparison::reporter_base
is the interface of reporter objects.

The current reporting using the current format is thus implemented by
the new abigail::comparison::default_reporter type, which implements
the abigail::comparison::reporter_base interface.

The diff::report methods now "just" get the reporter object from the
context of the diff and invoke its right reporting interface.

So whenever someone needs to implement a new reporting format, she
needs to provide a new implementation of the
abigail::comparison::reporter_base interface and set it to the
diff_context prior to invoking the
abigail::comparison::corpus_diff::report() method.

	* include/Makefile.am: Add the new abg-reporter.h header file to
	source distribution.
	* include/abg-comparison.h: Include the new abg-reporter.h header
	file.
	(diff_context::{g,s}et_reporter): Declare new accessors.
	({type_diff_base, decl_diff_base, corpus_diff}::priv): Make this
	be a struct rather than a class.
	({decl_diff_base, class_diff, scope_diff, function_type_diff,
	corpus_diff}): Declare default_reporter a friend class of these.
	* include/abg-reporter.h: New file.
	* src/Makefile.am: Add abg-comparison-priv.h,
	abg-reporter-priv.{h,cc} and abg-default-reporter.cc files to
	source distribution.
	* src/abg-comparison-priv.h: New file.
	* src/abg-comparison.cc (sort_enumerators)
	(sort_changed_enumerators, sort_data_members)
	(sort_string_function_ptr_map)
	(sort_string_function_decl_diff_sptr_map)
	(sort_string_var_diff_sptr_map, sort_string_elf_symbol_map)
	(sort_string_var_ptr_map, sort_string_data_member_diff_sptr_map)
	(sort_unsigned_data_member_diff_sptr_map)
	(sort_string_diff_sptr_map, sort_string_base_diff_sptr_map)
	(sort_string_base_sptr_map, sort_string_fn_parm_diff_sptr_map)
	(sort_string_parm_map, get_leaf_type, sort_enumerators)
	(sort_changed_enumerators): Make these functions non-static and
	move them at the beginning of the file.  These functions are now
	declared in abg-compared-priv.h so they can be shared privately
	with other files in src/.
	(diff_context::{g,s}et_reporter): Define new accessors.
	({diff_context, diff, type_diff_base, decl_diff_base,
	distinct_diff, pointer_diff, array_diff, reference_diff,
	qualified_type_diff, enum_diff, class_or_union_diff, class_diff,
	base_diff, scope_diff, fn_parm_diff, function_type_diff,
	function_decl_diff, type_decl_diff, typedef_diff,
	translation_unit_diff, corpus_diff::diff_stats,
	corpus_diff}::priv)
	(diff_less_than_functor, enumerator_value_comp)
	(changed_enumerator_comp, base_spec_comp, base_diff_comp)
	(data_member_diff_comp, diff_comp, fn_parm_diff_comp, parm_comp)
	(elf_symbol_comp, function_comp, function_decl_diff_comp)
	(var_diff_sptr_comp): Move these type definitions to
	abg-comparison-priv.h
	(report_size_and_alignment_changes, report_loc_info)
	(maybe_report_diff_for_member, maybe_report_diff_for_symbol)
	(represent, represent_data_member)
	(maybe_show_relative_offset_change, represent)
	(report_size_and_alignment_changes, report_loc_info)
	(report_name_size_and_alignment_changes, report_mem_header)
	(maybe_report_diff_for_member, maybe_report_diff_for_symbol)
	(show_linkage_name_and_aliases): Move these definitions to
	abg-reporter-priv.cc.
	({distinct_diff, var_diff, pointer_diff, array_diff,
	reference_diff, qualified_type_diff, enum_diff,
	class_or_union_diff, class_diff, base_diff, union_diff,
	scope_diff, fn_parm_diff, function_type_diff, type_decl_diff,
	typedef_diff, corpus_diff}::report): Use the reporter object to
	report about the changes carried by the the current diff node.
	* src/abg-default-reporter.cc: New file.
	* src/abg-reporter-priv.h: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-10-06 12:33:50 +02:00
..
abg-comp-filter.h Allow selective resolution of class declaration 2017-07-03 17:45:43 +02:00
abg-comparison.h Allow several kinds of reports to be emitted 2017-10-06 12:33:50 +02:00
abg-config.h Add --version option to several libabigail tools 2015-11-16 12:54:10 +01:00
abg-corpus.h Create a Corpus Group API extension 2017-07-03 17:45:36 +02:00
abg-diff-utils.h cppcheck: mitigate performance warnings 2017-04-14 04:41:44 -04:00
abg-dwarf-reader.h Bug 21644 - abipkgdiff does not emit diagnostics about comparison errors 2017-07-06 15:20:47 +02:00
abg-fwd.h Misc style fixes 2017-09-08 10:15:09 +02:00
abg-hash.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-ini.h Fix more clang build warnings 2017-06-02 23:12:14 +02:00
abg-interned-str.h Cleanup namespace importing in abg-interned-str.h 2016-10-10 12:57:47 +02:00
abg-ir.h Bug 21627 - Libabigail doesn't consider translation unit compile dir 2017-07-04 16:35:35 +02:00
abg-libxml-utils.h Initial support of de-serializing the KMI of a Linux Kernel Tree 2017-07-03 17:45:41 +02:00
abg-libzip-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-reader.h Initial support of de-serializing the KMI of a Linux Kernel Tree 2017-07-03 17:45:41 +02:00
abg-reporter.h Allow several kinds of reports to be emitted 2017-10-06 12:33:50 +02:00
abg-sptr-utils.h Setup per-corpus type maps indexed by type names 2016-11-29 16:16:43 +01:00
abg-suppression.h Make abipkgdiff compare two kernel packages 2017-07-03 17:45:36 +02:00
abg-tools-utils.h Bug 21730 - Make abipkgdiff compare Linux Kernel packages as expected 2017-07-17 16:41:07 +02: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 Add --version option to several libabigail tools 2015-11-16 12:54:10 +01:00
abg-viz-common.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-viz-dot.h cppcheck: mitigate performance warnings 2017-04-14 04:41:44 -04:00
abg-viz-svg.h cppcheck: mitigate performance warnings 2017-04-14 04:41:44 -04:00
abg-workers.h Several fixes and enhancements to abigail::workers 2017-02-27 09:48:08 +01:00
abg-writer.h Initial support of the serialization of the KMI of a Linux Kernel Tree 2017-07-03 17:45:41 +02:00
Makefile.am Allow several kinds of reports to be emitted 2017-10-06 12:33:50 +02:00