From 915bf047fb0a7f0c23ba9bd34c79641f93a5b6b8 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Tue, 21 Jul 2015 12:48:19 +0200 Subject: [PATCH] Add a new corpus_diff::has_net_changes() entry point This entry point is to test if there are still ABI changes between two corpora after applying suppression specifications. * include/abg-comparison.h (corpus_diff::has_net_changes): Declare new member function. * src/abg-comparison.cc (corpus_diff::has_net_changes): Define it. Signed-off-by: Dodji Seketeli --- include/abg-comparison.h | 3 +++ src/abg-comparison.cc | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/include/abg-comparison.h b/include/abg-comparison.h index 8950b194..f0c9efca 100644 --- a/include/abg-comparison.h +++ b/include/abg-comparison.h @@ -2635,6 +2635,9 @@ public: bool has_net_subtype_changes() const; + bool + has_net_changes() const; + const diff_stats& apply_filters_and_suppressions_before_reporting(); diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc index 4258d9e1..4776806e 100644 --- a/src/abg-comparison.cc +++ b/src/abg-comparison.cc @@ -13887,6 +13887,29 @@ corpus_diff::has_net_subtype_changes() const || stats.net_num_vars_changed() != 0); } +/// Test if the current instance of @ref corpus_diff carries changes +/// whose reports are not suppressed by any suppression specification. +/// In effect, these are deemed incompatible ABI changes. +/// +/// @return true iff the the current instance of @ref corpus_diff +/// carries subtype changes that are deemed incompatible ABI changes. +bool +corpus_diff::has_net_changes() const +{ + const diff_stats& stats = const_cast(this)-> + apply_filters_and_suppressions_before_reporting(); + + return (stats.net_num_func_changed() + || stats.net_num_vars_changed() + || stats.net_num_func_added() + || stats.net_num_added_func_syms() + || stats.net_num_func_removed() + || stats.net_num_removed_func_syms() + || stats.net_num_vars_added() + || stats.net_num_added_var_syms() + || stats.net_num_removed_var_syms()); +} + /// "Less than" functor to compare instances of @ref function_decl. struct function_comp { -- 2.43.5