libabigail
|
Abstraction of a type suppression specification. More...
#include <abg-suppression.h>
Classes | |
class | insertion_range |
The abstraction of a range of offsets in which a member of a type might get inserted. More... | |
class | priv |
The private data for type_suppression. More... | |
Public Types | |
typedef shared_ptr< insertion_range > | insertion_range_sptr |
A convenience typedef for a shared pointer to insertion_range. More... | |
typedef vector< insertion_range_sptr > | insertion_ranges |
A convenience typedef for a vector of insertion_range_sptr. More... | |
enum | reach_kind { DIRECT_REACH_KIND, POINTER_REACH_KIND, REFERENCE_REACH_KIND, REFERENCE_OR_POINTER_REACH_KIND } |
The different ways through which the type diff has been reached. More... | |
enum | type_kind { UNKNOWN_TYPE_KIND, CLASS_TYPE_KIND, STRUCT_TYPE_KIND, UNION_TYPE_KIND, ENUM_TYPE_KIND, ARRAY_TYPE_KIND, TYPEDEF_TYPE_KIND, BUILTIN_TYPE_KIND } |
The kind of the type the current type suppression is supposed to be about. More... | |
Public Member Functions | |
type_suppression (const string &label, const string &type_name_regexp, const string &type_name) | |
Constructor for type_suppression. More... | |
const vector< string > & | get_changed_enumerator_names () const |
Getter of the vector of the changed enumerators that are supposed to be suppressed. Note that this will be "valid" only if the type suppression has the 'type_kind = enum' property. More... | |
const vector< regex::regex_t_sptr > & | get_changed_enumerators_regexp () const |
Getter of the vector of the regular expression strings for changed enumerators that are supposed to be suppressed. Note that this will be "valid" only if the type suppression has the 'type_kind = enum' property. More... | |
bool | get_consider_reach_kind () const |
Test if the current type suppression specification suggests to consider how the matching diff node is reached. More... | |
bool | get_consider_type_kind () const |
Getter of the property that says whether to consider the kind of type this suppression is about. More... | |
const insertion_ranges & | get_data_member_insertion_ranges () const |
Getter for the vector of data member insertion range that specifiers where a data member is inserted as far as this suppression specification is concerned. More... | |
insertion_ranges & | get_data_member_insertion_ranges () |
Getter for the vector of data member insertion range that specifiers where a data member is inserted as far as this suppression specification is concerned. More... | |
bool | get_has_size_change () const |
Getter of the "has_size_change" property. More... | |
const string_set_type & | get_potential_data_member_names () const |
Getter of the "potential_data_member_names" property. More... | |
const string & | get_potential_data_member_names_regex_str () const |
Getter of the "potential_data_member_names_regex" string. More... | |
reach_kind | get_reach_kind () const |
Getter of the way the diff node matching the current suppression specification is to be reached. More... | |
const string & | get_source_location_to_keep_regex_str () const |
Getter of the regular expression string that designates the source location paths of types that should not be suppressed. More... | |
const unordered_set< string > & | get_source_locations_to_keep () const |
Getter for the array of source location paths of types that should *NOT* be suppressed. More... | |
unordered_set< string > & | get_source_locations_to_keep () |
Getter for the array of source location paths of types that should *NOT* be suppressed. More... | |
type_kind | get_type_kind () const |
Getter of the kind of type this suppression is about. More... | |
const string & | get_type_name () const |
Getter for the name of the type about which diff reports should be suppressed. More... | |
const string & | get_type_name_not_regex_str () const |
Getter for the "type_name_not_regex_str" property of the type suppression specification. More... | |
const string & | get_type_name_regex_str () const |
Getter for the "type_name_regex" property of the type suppression specification. More... | |
void | set_changed_enumerator_names (const vector< string > &) |
Setter of the vector of changed enumerators that are supposed to be suppressed. Note that this will be "valid" only if the type suppression has the 'type_kind = enum' property. More... | |
void | set_changed_enumerators_regexp (const vector< regex::regex_t_sptr > &) |
Setter of the vector of the regular expression strings for changed enumerators that are supposed to be suppressed. Note that this will be "valid" only if the type suppression has the 'type_kind = enum' property. More... | |
void | set_consider_reach_kind (bool f) |
Set a flag saying if the current type suppression specification suggests to consider how the matching diff node is reached. More... | |
void | set_consider_type_kind (bool f) |
Setter of the property that says whether to consider the kind of type this suppression is about. More... | |
void | set_data_member_insertion_ranges (const insertion_ranges &r) |
Setter for the vector of data member insertion ranges that specifies where a data member is inserted as far as this suppression specification is concerned. More... | |
void | set_has_size_change (bool flag) |
Setter of the "has_size_change" property. More... | |
void | set_potential_data_member_names (const string_set_type &) const |
Setter of the "potential_data_member_names" property. More... | |
void | set_potential_data_member_names_regex_str (const string &) const |
Setter of the "potential_data_member_names_regex" string. More... | |
void | set_reach_kind (reach_kind k) |
Setter of the way the diff node matching the current suppression specification is to be reached. More... | |
void | set_source_location_to_keep_regex_str (const string &) |
Setter of the regular expression string that designates the source location paths of types that should not be suppressed. More... | |
void | set_source_locations_to_keep (const unordered_set< string > &) |
Setter for the array of source location paths of types that should *NOT* be suppressed. More... | |
void | set_type_kind (type_kind k) |
Setter of the kind of type this suppression is about. More... | |
void | set_type_name (const string &name) |
Setter for the name of the type about which diff reports should be suppressed. More... | |
void | set_type_name_not_regex_str (const string &name_regex_str) |
Setter for the "type_name_not_regex_str" property of the type suppression specification. More... | |
void | set_type_name_regex_str (const string &name_regex_str) |
Setter for the "type_name_regex" property of the type suppression specification. More... | |
virtual bool | suppresses_diff (const diff *diff) const |
Evaluate this suppression specification on a given diff node and say if the diff node should be suppressed or not. More... | |
bool | suppresses_type (const type_base_sptr &type, const diff_context_sptr &ctxt) const |
Test if the current instance of type_suppression suppresses a change reports about a given type. More... | |
bool | suppresses_type (const type_base_sptr &type) const |
Test if the current instance of type_suppression matches a given type. More... | |
bool | suppresses_type (const type_base_sptr &type, const scope_decl *type_scope) const |
Test if the current instance of type_suppression matches a given type in a given scope. More... | |
![]() | |
suppression_base (const string &label) | |
Constructor for suppression_base. More... | |
suppression_base (const string &label, const string &file_name_regex_str, const string &file_name_not_regex_str) | |
Constructor for suppression_base. More... | |
bool | get_drops_artifact_from_ir () const |
Tests if the current suppression specification is to avoid adding the matched ABI artifact to the internal representation or not. More... | |
const string & | get_file_name_not_regex_str () const |
Getter for the "file_name_not_regex" property of the current instance of suppression_base. More... | |
const string & | get_file_name_regex_str () const |
Getter for the "file_name_regex" property of the current instance of suppression_base. More... | |
bool | get_is_artificial () const |
Test is the suppression specification is artificial. More... | |
const string | get_label () const |
Getter for the label associated to this suppression specification. More... | |
const string & | get_soname_not_regex_str () const |
Getter of the "soname_not_regex_str property of the current instance of suppression_base. More... | |
const string & | get_soname_regex_str () const |
Getter of the "soname_regex_str property of the current instance of suppression_base. More... | |
bool | has_file_name_related_property () const |
Test if the current suppression has a property related to file name. More... | |
bool | has_soname_related_property () const |
Test if the current suppression has a property related to SONAMEs. More... | |
void | set_drops_artifact_from_ir (bool) |
Set the flag that says whether the current suppression specification is to avoid adding the matched ABI artifact to the internal representation or not. More... | |
void | set_file_name_not_regex_str (const string ®exp) |
Setter for the "file_name_not_regex" property of the current instance of suppression_base. More... | |
void | set_file_name_regex_str (const string ®exp) |
Setter for the "file_name_regex" property of the current instance of suppression_base. More... | |
void | set_is_artificial (bool) |
Set a flag saying if the suppression specification is artificial or not. More... | |
void | set_label (const string &) |
Setter for the label associated to this suppression specification. More... | |
void | set_soname_not_regex_str (const string ®exp) |
Setter of the "soname_not_regex_str property of the current instance of suppression_base. More... | |
void | set_soname_regex_str (const string ®exp) |
Setter of the "soname_regex_str property of the current instance of suppression_base. More... | |
Public Attributes | |
std::unique_ptr< priv > | priv_ |
![]() | |
std::unique_ptr< priv > | priv_ |
Abstraction of a type suppression specification.
Specifies under which condition reports about a type diff node should be dropped on the floor.
Definition at line 186 of file abg-suppression.h.
typedef shared_ptr<insertion_range> insertion_range_sptr |
A convenience typedef for a shared pointer to insertion_range.
Definition at line 230 of file abg-suppression.h.
typedef vector<insertion_range_sptr> insertion_ranges |
A convenience typedef for a vector of insertion_range_sptr.
Definition at line 235 of file abg-suppression.h.
enum reach_kind |
The different ways through which the type diff has been reached.
Definition at line 211 of file abg-suppression.h.
enum type_kind |
The kind of the type the current type suppression is supposed to be about.
Definition at line 198 of file abg-suppression.h.
type_suppression | ( | const string & | label, |
const string & | type_name_regexp, | ||
const string & | type_name | ||
) |
Constructor for type_suppression.
label | the label of the suppression. This is just a free form comment explaining what the suppression is about. |
type_name_regexp | the regular expression describing the types about which diff reports should be suppressed. If it's an empty string, the parameter is ignored. |
type_name | the name of the type about which diff reports should be suppressed. If it's an empty string, the parameter is ignored. |
Note that parameter type_name_regexp
and type_name_regexp
should not necessarily be populated. It usually is either one or the other that the user wants.
Definition at line 503 of file abg-suppression.cc.
const vector< string > & get_changed_enumerator_names | ( | ) | const |
Getter of the vector of the changed enumerators that are supposed to be suppressed. Note that this will be "valid" only if the type suppression has the 'type_kind = enum' property.
Definition at line 776 of file abg-suppression.cc.
const vector< regex::regex_t_sptr > & get_changed_enumerators_regexp | ( | ) | const |
Getter of the vector of the regular expression strings for changed enumerators that are supposed to be suppressed. Note that this will be "valid" only if the type suppression has the 'type_kind = enum' property.
Definition at line 797 of file abg-suppression.cc.
bool get_consider_reach_kind | ( | ) | const |
Test if the current type suppression specification suggests to consider how the matching diff node is reached.
Definition at line 622 of file abg-suppression.cc.
bool get_consider_type_kind | ( | ) | const |
Getter of the property that says whether to consider the kind of type this suppression is about.
Definition at line 583 of file abg-suppression.cc.
const type_suppression::insertion_ranges & get_data_member_insertion_ranges | ( | ) | const |
Getter for the vector of data member insertion range that specifiers where a data member is inserted as far as this suppression specification is concerned.
Definition at line 714 of file abg-suppression.cc.
type_suppression::insertion_ranges & get_data_member_insertion_ranges | ( | ) |
Getter for the vector of data member insertion range that specifiers where a data member is inserted as far as this suppression specification is concerned.
Definition at line 723 of file abg-suppression.cc.
bool get_has_size_change | ( | ) | const |
Getter of the "has_size_change" property.
Definition at line 657 of file abg-suppression.cc.
const unordered_set< string > & get_potential_data_member_names | ( | ) | const |
Getter of the "potential_data_member_names" property.
Definition at line 672 of file abg-suppression.cc.
const string & get_potential_data_member_names_regex_str | ( | ) | const |
Getter of the "potential_data_member_names_regex" string.
Definition at line 688 of file abg-suppression.cc.
type_suppression::reach_kind get_reach_kind | ( | ) | const |
Getter of the way the diff node matching the current suppression specification is to be reached.
Definition at line 641 of file abg-suppression.cc.
const string & get_source_location_to_keep_regex_str | ( | ) | const |
Getter of the regular expression string that designates the source location paths of types that should not be suppressed.
Definition at line 758 of file abg-suppression.cc.
const unordered_set< string > & get_source_locations_to_keep | ( | ) | const |
Getter for the array of source location paths of types that should *NOT* be suppressed.
Definition at line 732 of file abg-suppression.cc.
unordered_set< string > & get_source_locations_to_keep | ( | ) |
Getter for the array of source location paths of types that should *NOT* be suppressed.
Definition at line 741 of file abg-suppression.cc.
type_suppression::type_kind get_type_kind | ( | ) | const |
Getter of the kind of type this suppression is about.
Note that this will be considered during evaluation of the suppression only if type_suppression::get_consider_type_kind() returns true.
Definition at line 613 of file abg-suppression.cc.
const string & get_type_name | ( | ) | const |
Getter for the name of the type about which diff reports should be suppressed.
return | the type name. |
Definition at line 575 of file abg-suppression.cc.
const string & get_type_name_not_regex_str | ( | ) | const |
Getter for the "type_name_not_regex_str" property of the type suppression specification.
This returns a regular expression string that specifies the family of types that should be kept after suppression.
Definition at line 559 of file abg-suppression.cc.
const string & get_type_name_regex_str | ( | ) | const |
Getter for the "type_name_regex" property of the type suppression specification.
This returns a regular expression string that specifies the family of types about which diff reports should be suppressed.
Definition at line 537 of file abg-suppression.cc.
void set_changed_enumerator_names | ( | const vector< string > & | n | ) |
Setter of the vector of changed enumerators that are supposed to be suppressed. Note that this will be "valid" only if the type suppression has the 'type_kind = enum' property.
n | the vector of the changed enumerators that are supposed to be suppressed. |
Definition at line 786 of file abg-suppression.cc.
void set_changed_enumerators_regexp | ( | const vector< regex::regex_t_sptr > & | n | ) |
Setter of the vector of the regular expression strings for changed enumerators that are supposed to be suppressed. Note that this will be "valid" only if the type suppression has the 'type_kind = enum' property.
n | the vector of the regular expression strings that are supposed to match enumertor names to be suppressed. |
Definition at line 808 of file abg-suppression.cc.
void set_consider_reach_kind | ( | bool | f | ) |
Set a flag saying if the current type suppression specification suggests to consider how the matching diff node is reached.
f | the new value of the flag. It's true iff the current type suppression specification suggests to consider how the matching diff node is reached. |
Definition at line 632 of file abg-suppression.cc.
void set_consider_type_kind | ( | bool | f | ) |
Setter of the property that says whether to consider the kind of type this suppression is about.
f | the new boolean value of the property. |
Definition at line 591 of file abg-suppression.cc.
void set_data_member_insertion_ranges | ( | const insertion_ranges & | r | ) |
Setter for the vector of data member insertion ranges that specifies where a data member is inserted as far as this suppression specification is concerned.
r | the new insertion range vector. |
Definition at line 705 of file abg-suppression.cc.
void set_has_size_change | ( | bool | flag | ) |
Setter of the "has_size_change" property.
flag | the new value of the "has_size_change" property. |
Definition at line 664 of file abg-suppression.cc.
void set_potential_data_member_names | ( | const string_set_type & | s | ) | const |
Setter of the "potential_data_member_names" property.
s | the new set of potential data member names of this suppression. |
Definition at line 681 of file abg-suppression.cc.
void set_potential_data_member_names_regex_str | ( | const string & | d | ) | const |
Setter of the "potential_data_member_names_regex" string.
d | the new "potential_data_member_names_regex" string. |
Definition at line 696 of file abg-suppression.cc.
void set_reach_kind | ( | reach_kind | k | ) |
Setter of the way the diff node matching the current suppression specification is to be reached.
p | the way the diff node matching the current suppression specification is to be reached. |
Definition at line 650 of file abg-suppression.cc.
void set_source_location_to_keep_regex_str | ( | const string & | r | ) |
Setter of the regular expression string that designates the source location paths of types that should not be suppressed.
r | the new regular expression. |
Definition at line 766 of file abg-suppression.cc.
void set_source_locations_to_keep | ( | const unordered_set< string > & | l | ) |
Setter for the array of source location paths of types that should *NOT* be suppressed.
l | the new array. |
Definition at line 750 of file abg-suppression.cc.
void set_type_kind | ( | type_kind | k | ) |
Setter of the kind of type this suppression is about.
Note that this will be considered during evaluation of the suppression only if type_suppression::get_consider_type_kind() returns true.
k | the new kind of type this suppression is about. |
Definition at line 602 of file abg-suppression.cc.
void set_type_name | ( | const string & | name | ) |
Setter for the name of the type about which diff reports should be suppressed.
name | the new type name. |
Definition at line 567 of file abg-suppression.cc.
void set_type_name_not_regex_str | ( | const string & | r | ) |
Setter for the "type_name_not_regex_str" property of the type suppression specification.
This returns a regular expression string that specifies the family of types that should be kept after suppression.
r | the new regexp string. |
Definition at line 548 of file abg-suppression.cc.
void set_type_name_regex_str | ( | const string & | name_regex_str | ) |
Setter for the "type_name_regex" property of the type suppression specification.
This sets a regular expression that specifies the family of types about which diff reports should be suppressed.
name_regex_str | the new regular expression to set. |
Definition at line 526 of file abg-suppression.cc.
|
virtual |
Evaluate this suppression specification on a given diff node and say if the diff node should be suppressed or not.
diff | the diff node to evaluate this suppression specification against. |
diff
should be suppressed. Implements suppression_base.
Reimplemented in negated_type_suppression.
Definition at line 819 of file abg-suppression.cc.
bool suppresses_type | ( | const type_base_sptr & | type, |
const diff_context_sptr & | ctxt | ||
) | const |
Test if the current instance of type_suppression suppresses a change reports about a given type.
type | the type to consider. |
ctxt | the context of comparison we are involved with. |
type
. Definition at line 1088 of file abg-suppression.cc.
bool suppresses_type | ( | const type_base_sptr & | type | ) | const |
Test if the current instance of type_suppression matches a given type.
type | the type to consider. |
type
. Definition at line 1367 of file abg-suppression.cc.
bool suppresses_type | ( | const type_base_sptr & | type, |
const scope_decl * | type_scope | ||
) | const |
Test if the current instance of type_suppression matches a given type in a given scope.
type | the type to consider. |
type_scope | the scope of type type . |
type
from scope type_scope
. Definition at line 1388 of file abg-suppression.cc.