8 #ifndef __ABG_SUPPRESSION_H__
9 #define __ABG_SUPPRESSION_H__
11 #include <unordered_set>
32 using std::unordered_set;
34 using std::shared_ptr;
59 std::unique_ptr<priv> priv_;
64 const string& file_name_regex_str,
65 const string& file_name_not_regex_str);
116 suppresses_diff(
const diff*)
const = 0;
126 const string& filename,
138 suppressions_type& suppressions);
142 suppressions_type& suppressions);
179 negated_suppression_sptr
194 std::unique_ptr<priv> priv_;
238 const string& type_name_regexp,
239 const string& type_name);
291 const string_set_type&
306 const insertion_ranges&
312 const unordered_set<string>&
315 unordered_set<string>&
327 const vector<string>&
333 const vector<regex::regex_t_sptr>&
354 type_suppression_sptr
362 std::unique_ptr<priv> priv_;
430 std::unique_ptr<priv> priv_;
443 std::unique_ptr<priv> priv_;
450 operator uint64_t ()
const;
461 std::unique_ptr<priv> priv_;
479 std::unique_ptr<priv> priv_;
499 const string& type_name_regexp,
500 const string& type_name);
506 suppresses_type(
const type_base_sptr& type,
510 suppresses_type(
const type_base_sptr& type)
const;
513 suppresses_type(
const type_base_sptr& type,
538 std::unique_ptr<priv> priv_;
551 UNDEFINED_CHANGE_KIND,
570 const string& name_regex,
571 const string& return_type_name,
572 const string& return_type_regex,
573 parameter_specs_type& parm_specs,
574 const string& symbol_name,
575 const string& symbol_name_regex,
576 const string& symbol_version,
577 const string& symbol_version_regex_str);
620 const parameter_specs_type&
689 function_suppression_sptr
707 std::unique_ptr<priv> priv_;
714 const string& type_name,
715 const string& type_name_regex);
724 get_parameter_type_name()
const;
727 set_parameter_type_name(
const string&);
730 get_parameter_type_name_regex_str()
const;
733 set_parameter_type_name_regex_str(
const string&);
759 UNDEFINED_CHANGE_KIND,
761 VARIABLE_SUBTYPE_CHANGE_KIND = 1,
764 ADDED_VARIABLE_CHANGE_KIND = 1 << 1,
766 DELETED_VARIABLE_CHANGE_KIND = 1 << 2,
771 | ADDED_VARIABLE_CHANGE_KIND
772 | DELETED_VARIABLE_CHANGE_KIND)
779 std::unique_ptr<priv> priv_;
782 const string& name =
"",
783 const string& name_regex_str =
"",
784 const string& symbol_name =
"",
785 const string& symbol_name_regex_str =
"",
786 const string& symbol_version =
"",
787 const string& symbol_version_regex_str =
"",
788 const string& type_name =
"",
789 const string& type_name_regex_str =
"");
854 set_type_name(
const string&);
857 get_type_name_regex_str()
const;
860 set_type_name_regex_str(
const string&);
866 suppresses_variable(
const var_decl* var,
876 suppresses_variable_symbol(
const elf_symbol* sym,
886 variable_suppression_sptr
909 std::unique_ptr<priv> priv_;
917 const string& file_name_regex,
918 const string& file_name_not_regex);
924 suppresses_file(
const string& file_path);
929 file_suppression_sptr
932 file_suppression_sptr
934 const suppressions_type& suppressions);
942 const string& filename,
959 suppression_matches_function_name(
const fe_iface&,
964 suppression_matches_function_sym_name(
const fe_iface&,
966 const string& fn_linkage_name);
971 const string& var_name);
990 const string& sym_name,
995 const string& fn_name,
996 const string& fn_linkage_name,
997 bool require_drop_property =
false);
1001 const string& var_name,
1002 const string& var_linkage_name,
1003 bool require_drop_property =
false);
1007 const string& type_name,
1009 bool& type_is_private,
1010 bool require_drop_property =
false);
1022 #endif //__ABG_SUPPRESSION_H__
bool is_type_suppressed(const fe_iface &fe, const string &type_name, const location &type_location, bool &type_is_private, bool require_drop_property)
Test if a type is matched by at least one suppression specification associated with a given front-end...
bool is_elf_symbol_suppressed(const fe_iface &fe, const elf_symbol_sptr &symbol)
Test if an ELF symbol is suppressed by at least one of the suppression specifications associated with...
shared_ptr< negated_suppression_base > negated_suppression_sptr
A convenience typedef for a shared pointer to negated_suppression_base.
void set_type_kind(type_kind k)
Setter of the kind of type this suppression is about.
type_kind
The kind of the type the current type suppression is supposed to be about.
const string & get_name_not_regex_str() const
Getter for a regular expression of a family of names of functions the user wants the current specific...
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.
void set_name_not_regex_str(const string &)
Setter for a regular expression for a family of names of functions the user wants the current specifi...
void set_consider_type_kind(bool f)
Setter of the property that says whether to consider the kind of type this suppression is about...
type_suppression_sptr is_type_suppression(suppression_sptr suppr)
Test if an instance of suppression is an instance of type_suppression.
bool suppression_can_match(const fe_iface &fe, const suppression_base &s)
Test if a given suppression specification can match an ABI artifact coming from the corpus being anal...
function_suppression_sptr is_function_suppression(const suppression_sptr suppr)
Test if an instance of suppression is an instance of function_suppression.
An insertion_range boundary that is expressed as function call expression. The (integer) value of tha...
const string & get_type_name_not_regex_str() const
Getter for the "type_name_not_regex_str" property of the type suppression specification.
The abstraction of a change between two ABI artifacts, a.k.a an artifact change.
void set_name(const string &)
Setter for the name of the function the user wants the current specification to designate. This might be empty, in which case it's ignored at evaluation time.
const string & get_file_name_regex_str() const
Getter for the "file_name_regex" property of the current instance of suppression_base.
static insertion_range::fn_call_expr_boundary_sptr create_fn_call_expr_boundary(ini::function_call_expr_sptr)
Create a function call expression boundary.
void set_return_type_regex_str(const string &r)
Setter for a regular expression for a family of return type names for functions the user wants the cu...
insertion_range()
Default Constructor of type_suppression::insertion_range.
An insertion_range boundary that is expressed as a named constant that is to be evaluated later in th...
The type diff has been reached (from a function or variable change) through a reference; you know...
The base class of all libabigail front-ends: The Front End Interface.
void set_consider_reach_kind(bool f)
Set a flag saying if the current type suppression specification suggests to consider how the matching...
vector< negated_suppression_sptr > negated_suppressions_type
Convenience typedef for a vector of negated_suppression_sptr.
shared_ptr< suppression_base > suppression_sptr
Convenience typedef for a shared pointer to a suppression.
static insertion_range::named_boundary_sptr create_named_boundary(const string &)
Create a named boundary.
Abstraction of a suppression specification to avoid loading a file.
The type diff has been reached (from a function or variable change) through a pointer.
The type of the private data of the function_suppression type.
This file contains the declarations for the ini file reader used in the libabigail library...
type_suppression::insertion_range::fn_call_expr_boundary_sptr is_fn_call_expr_boundary(type_suppression::insertion_range::boundary_sptr b)
Tests if a given instance of type_suppression::insertion_range::boundary is actually a function call ...
A declaration that introduces a scope.
bool is_negated_suppression(const suppression_base &s)
Test if a suppression specification is a negated suppression.
The type diff has been reached (from a function or variable change) through either a reference or a p...
negated_type_suppression(const string &label, const string &type_name_regexp, const string &type_name)
Constructor for negated_type_suppression.
shared_ptr< function_call_expr > function_call_expr_sptr
Convenience typedef for a shared pointer to function_call_expr.
bool has_file_name_related_property() const
Test if the current suppression has a property related to file name.
void set_is_artificial(bool)
Set a flag saying if the suppression specification is artificial or not.
const string & get_soname_not_regex_str() const
Getter of the "soname_not_regex_str property of the current instance of suppression_base.
shared_ptr< diff_context > diff_context_sptr
Convenience typedef for a shared pointer of diff_context.
bool get_drops_artifact_from_ir() const
Tests if the current suppression specification is to avoid adding the matched ABI artifact to the int...
static bool eval_boundary(const boundary_sptr boundary, const class_or_union *context, uint64_t &value)
Evaluate an insertion range boundary to get a resulting integer value.
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 shoul...
const string & get_symbol_name() const
Getter for the name of symbol of the function the user wants this specification to designate...
friend bool suppression_matches_soname(const string &soname, const suppression_base &suppr)
Test if a given SONAME is matched by a given suppression specification.
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
The private data for type_suppression.
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 b...
void set_soname_not_regex_str(const string ®exp)
Setter of the "soname_not_regex_str property of the current instance of suppression_base.
shared_ptr< file_suppression > file_suppression_sptr
A convenience typedef for a shared_ptr to file_suppression.
bool get_is_artificial() const
Test is the suppression specification is artificial.
file_suppression_sptr is_file_suppression(const suppression_sptr s)
Test if a given suppression specification is a file suppression specification.
bool get_allow_other_aliases() const
Getter for the "allow_other_aliases" property of the function suppression specification.
const string & get_name_regex_str() const
Getter for a regular expression for a family of names of functions the user wants the current specifi...
virtual ~boundary()
Destructor of type_suppression::insertion_range::boundary.
const string & get_type_name_regex_str() const
Getter for the "type_name_regex" property of the type suppression specification.
bool suppression_matches_type_name_or_location(const type_suppression &s, const string &type_name, const location &type_location)
Test if a type suppression matches a type name and location.
The abstraction of the boundary of an insertion_range, in the context of a type_suppression.
void set_type_name(const string &name)
Setter for the name of the type about which diff reports should be suppressed.
static insertion_range::integer_boundary_sptr create_integer_boundary(int value)
Create an integer boundary.
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 suppr...
void set_symbol_version(const string &)
Setter for the name of the version of the symbol of the function the user wants this specification to...
shared_ptr< type_suppression > type_suppression_sptr
Convenience typedef for a shared pointer to type_suppression.
bool suppression_matches_variable_name(const suppr::variable_suppression &s, const string &var_name)
Test if a variable suppression matches a variable denoted by its name.
Abstracts a variable declaration.
bool is_data_member_offset_in_range(const var_decl_sptr &dm, const type_suppression::insertion_range_sptr &range, const class_or_union *context)
Test if a data memer offset is in a given insertion range.
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 suppr...
void set_return_type_name(const string &)
Setter for the name of the return type of the function the user wants this specification to designate...
bool is_variable_suppressed(const fe_iface &fe, const string &var_name, const string &var_linkage_name, bool require_drop_property)
Test if a variable is matched by at least one suppression specification associated with a given front...
static bool boundary_value_is_end(uint64_t value)
Test if a given value supposed to be inside an insertion range represents the end of the range...
bool suppresses_function_symbol(const elf_symbol *sym, change_kind k, const diff_context_sptr ctxt)
Evaluate the current function suppression specification on a given elf_symbol and say if a report abo...
ini::function_call_expr_sptr as_function_call_expr() const
Returns the function call expression value of the current boundary.
const string & get_potential_data_member_names_regex_str() const
Getter of the "potential_data_member_names_regex" string.
void set_potential_data_member_names_regex_str(const string &) const
Setter of the "potential_data_member_names_regex" string.
bool suppresses_function(const function_decl *fn, change_kind k, const diff_context_sptr ctxt) const
Evaluate the current function suppression specification on a given function_decl and say if a report ...
const string & get_symbol_version() const
Getter for the name of the version of the symbol of the function the user wants this specification to...
void set_type_name_regex_str(const string &name_regex_str)
Setter for the "type_name_regex" property of the type suppression specification.
shared_ptr< insertion_range > insertion_range_sptr
A convenience typedef for a shared pointer to insertion_range.
Toplevel namespace for libabigail.
bool get_consider_reach_kind() const
Test if the current type suppression specification suggests to consider how the matching diff node is...
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.
change_kind get_change_kind() const
Getter of the "change-kind" property.
shared_ptr< function_decl > function_decl_sptr
Convenience typedef for a shared pointer on a function_decl.
friend bool suppression_matches_soname_or_filename(const string &soname, const string &filename, const suppression_base &suppr)
Test if a given SONAME or file name is matched by a given suppression specification.
The type of the private data of the variable_suppression type.
vector< function_suppression_sptr > function_suppressions_type
Convenience typedef for a vector of function_suppression_sptr.
boundary_sptr begin() const
Getter for the beginning of the range.
reach_kind
The different ways through which the type diff has been reached.
const string & get_symbol_name_not_regex_str() const
Getter for a regular expression for a family of names of symbols of functions the user wants this spe...
type_suppression::insertion_range::named_boundary_sptr is_named_boundary(type_suppression::insertion_range::boundary_sptr b)
Test if a given instance of type_suppression::insertion_range::boundary is actually a named boundary...
vector< variable_suppression_sptr > variable_suppressions_type
A convenience typedef for a vector of variable_suppression_sptr.
bool suppression_matches_variable_sym_name(const suppr::variable_suppression &s, const string &var_linkage_name)
Test if a variable suppression matches a variable denoted by its symbol name.
void set_symbol_version_regex_str(const string &)
Setter for a regular expression for a family of versions of symbols of functions the user wants the c...
The type diff has been reached (from a function or variable change) directly.
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.
void read_suppressions(std::istream &input, suppressions_type &suppressions)
Read suppressions specifications from an input stream.
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 b...
Abstraction for a function declaration.
type_kind get_type_kind() const
Getter of the kind of type this suppression is about.
Types of the main internal representation of libabigail.
const string & get_return_type_name() const
Getter for the name of the return type of the function the user wants this specification to designate...
vector< insertion_range_sptr > insertion_ranges
A convenience typedef for a vector of insertion_range_sptr.
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...
The base type of class_decl and union_decl.
type
The type of a symbol.
The source location of a token.
const string & get_soname_regex_str() const
Getter of the "soname_regex_str property of the current instance of suppression_base.
~integer_boundary()
Destructor of type_suppression::insertion_range::integer_boundary.
boundary_sptr end() const
Getter for the end of the range.
Abstraction of an elf symbol.
void set_symbol_name_not_regex_str(const string &)
Setter for a regular expression for a family of names of symbols of functions the user wants this spe...
The function was deleted from the second subject of the diff.
shared_ptr< named_boundary > named_boundary_sptr
Convenience typedef for a shared_ptr to a named_boundary.
function_suppression::change_kind operator|(function_suppression::change_kind l, function_suppression::change_kind r)
The bitwise 'or' operator for the enum function_suppression::change_kind.
boundary()
Default constructor of type_suppression::insertion_range::boundary.
shared_ptr< elf_symbol > elf_symbol_sptr
A convenience typedef for a shared pointer to elf_symbol.
function_suppression()
Default constructor for the function_suppression type.
virtual ~negated_type_suppression()
Destructor of the negated_type_suppression type.
Base type of a direct suppression specifications types.
virtual ~negated_suppression_base()
Destructor of the negated_suppression_base.
type_suppression::insertion_range::integer_boundary_sptr is_integer_boundary(type_suppression::insertion_range::boundary_sptr b)
Tests if a given instance of type_suppression::insertion_range::boundary is actually an integer bound...
change_kind
The kind of change the current function suppression should apply to.
void set_allow_other_aliases(bool f)
Setter for the "allow_other_aliases" property of the function suppression specification.
vector< suppression_sptr > suppressions_type
Convenience typedef for a vector of suppression_sptr.
variable_suppression_sptr is_variable_suppression(const suppression_sptr s)
Test if an instance of suppression is an instance of variable_suppression.
shared_ptr< parameter_spec > parameter_spec_sptr
Convenience typedef for shared_ptr of parameter_spec.
void append_parameter_specs(const parameter_spec_sptr)
Append a specification of a parameter of the function specification.
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 ...
void set_potential_data_member_names(const string_set_type &) const
Setter of the "potential_data_member_names" property.
const string & get_file_name_not_regex_str() const
Getter for the "file_name_not_regex" property of the current instance of suppression_base.
static change_kind parse_change_kind(const string &)
Parses a string containing the content of the "change-kind" property and returns the an instance of f...
change_kind
The kind of change the current variable suppression should apply to.
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 suppr...
vector< parameter_spec_sptr > parameter_specs_type
Convenience typedef for vector of parameter_spec_sptr.
The function was added to the second subject of the diff.
Abstraction of a type suppression specification.
shared_ptr< fn_call_expr_boundary > fn_call_expr_boundary_sptr
Convenience typedef for a shared_ptr to a fn_call_expr_boundary.
file_suppression_sptr file_is_suppressed(const string &file_path, const suppressions_type &sprs)
Test if a given file path is "suppressed" by at least one file suppression specification among a vect...
void set_reach_kind(reach_kind k)
Setter of the way the diff node matching the current suppression specification is to be reached...
const string & get_type_name() const
Getter for the name of the type about which diff reports should be suppressed.
const string & get_name() const
Getter for the name of the named boundary.
void set_symbol_name(const string &n)
Setter for the name of symbol of the function the user wants this specification to designate...
const parameter_specs_type & get_parameter_specs() const
Getter for a vector of parameter specifications to specify properties of the parameters of the functi...
void set_change_kind(change_kind k)
Setter of the "change-kind" property.
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 ...
interned_string get_type_name(const type_base_sptr &t, bool qualified, bool internal)
Get the name of a given type and return a copy of it.
bool get_has_size_change() const
Getter of the "has_size_change" property.
const string get_label() const
Getter for the label associated to this suppression specification.
void set_has_size_change(bool flag)
Setter of the "has_size_change" property.
void set_parameter_specs(parameter_specs_type &)
Setter for a vector of parameter specifications to specify properties of the parameters of the functi...
The private data of suppression_base.
void set_label(const string &)
Setter for the label associated to this suppression specification.
Abstraction of a function suppression specification.
shared_ptr< boundary > boundary_sptr
Convenience typedef for a shared_ptr to boundary.
const char * get_private_types_suppr_spec_label()
void set_drops_artifact_from_ir(bool)
Set the flag that says whether the current suppression specification is to avoid adding the matched A...
Abstraction of the specification of a function parameter in a function suppression specification...
The abstraction of a variable suppression specification.
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 shoul...
const string & get_return_type_regex_str() const
Getter for a regular expression for a family of return type names for functions the user wants the cu...
An insertion_range boundary that is expressed as an integer value. That integer value is usually a bi...
~fn_call_expr_boundary()
Destructor of type_suppression::insertion_range::fn_call_expr_boundary.
uint64_t as_integer() const
Return the integer value of the current instance of type_suppression::insertion_range::integer_bounda...
vector< type_suppression_sptr > type_suppressions_type
Convenience typedef for vector of type_suppression_sptr.
The base class of suppression specifications that are defined by the negation of matching clauses...
shared_ptr< variable_suppression > variable_suppression_sptr
A convenience typedef for a shared pointer to variable_suppression.
void set_soname_regex_str(const string ®exp)
Setter of the "soname_regex_str property of the current instance of suppression_base.
bool is_private_type_suppr_spec(const type_suppression &s)
Test if a type suppression specification represents a private type suppression automatically generate...
shared_ptr< integer_boundary > integer_boundary_sptr
Convenience typedef for a shared_ptr to a integer_boundary.
void set_file_name_regex_str(const string ®exp)
Setter for the "file_name_regex" property of the current instance of suppression_base.
shared_ptr< function_suppression > function_suppression_sptr
Convenience typedef for a shared pointer to function_suppression.
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.
const string & get_symbol_name_regex_str() const
Getter for a regular expression for a family of names of symbols of functions the user wants this spe...
A change in a sub-type of the function.
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.
The abstraction of a range of offsets in which a member of a type might get inserted.
const string & get_symbol_version_regex_str() const
Getter for a regular expression for a family of versions of symbols of functions the user wants the c...
reach_kind get_reach_kind() const
Getter of the way the diff node matching the current suppression specification is to be reached...
Abstraction of a negated type suppression specification.
void set_name_regex_str(const string &)
Setter for a regular expression for a family of names of functions the user wants the current specifi...
const string & get_name() const
Getter for the name of the function the user wants the current specification to designate. This might be empty, in which case it's ignored at evaluation time.
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 b...
void set_symbol_name_regex_str(const string &)
Setter for a regular expression for a family of names of symbols of functions the user wants this spe...
const string_set_type & get_potential_data_member_names() const
Getter of the "potential_data_member_names" property.
bool get_consider_type_kind() const
Getter of the property that says whether to consider the kind of type this suppression is about...
function_suppression::change_kind operator&(function_suppression::change_kind l, function_suppression::change_kind r)
The bitwise 'and' operator for the enum function_suppression::change_kind.
bool has_soname_related_property() const
Test if the current suppression has a property related to SONAMEs.
This represents all the changes possibly described by this enum. It's a logical 'OR' of all the chang...
negated_suppression_base()
Constructor of the negated_suppression_base.
bool is_function_suppressed(const fe_iface &fe, const string &fn_name, const string &fn_linkage_name, bool require_drop_property)
Test if a function is matched by at least one suppression specification associated with a given front...