libabigail
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
function_suppression Class Reference

Abstraction of a function suppression specification. More...

#include <abg-suppression.h>

Inheritance diagram for function_suppression:
[legend]

Classes

class  parameter_spec
 Abstraction of the specification of a function parameter in a function suppression specification. More...
 
struct  priv
 The type of the private data of the function_suppression type. More...
 

Public Types

enum  change_kind {
  UNDEFINED_CHANGE_KIND , FUNCTION_SUBTYPE_CHANGE_KIND , ADDED_FUNCTION_CHANGE_KIND , DELETED_FUNCTION_CHANGE_KIND ,
  ALL_CHANGE_KIND
}
 The kind of change the current function suppression should apply to. More...
 
typedef shared_ptr< parameter_specparameter_spec_sptr
 Convenience typedef for shared_ptr of parameter_spec. More...
 
typedef vector< parameter_spec_sptrparameter_specs_type
 Convenience typedef for vector of parameter_spec_sptr. More...
 

Public Member Functions

 function_suppression ()
 Default constructor for the function_suppression type. More...
 
 function_suppression (const string &label, const string &name, const string &name_regex, const string &return_type_name, const string &return_type_regex, parameter_specs_type &parm_specs, const string &symbol_name, const string &symbol_name_regex, const string &symbol_version, const string &symbol_version_regex_str)
 Constructor for the function_suppression type. More...
 
void append_parameter_specs (const parameter_spec_sptr)
 Append a specification of a parameter of the function specification. More...
 
bool get_allow_other_aliases () const
 Getter for the "allow_other_aliases" property of the function suppression specification. More...
 
change_kind get_change_kind () const
 Getter of the "change-kind" property. More...
 
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. More...
 
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 specification to designate the negation of. More...
 
const string & get_name_regex_str () const
 Getter for a regular expression for a family of names of functions the user wants the current specification to designate. More...
 
const parameter_specs_typeget_parameter_specs () const
 Getter for a vector of parameter specifications to specify properties of the parameters of the functions the user wants this specification to designate. More...
 
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. This property might be empty, in which case it's ignored at evaluation time. More...
 
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 current specification to designate. More...
 
const string & get_symbol_name () const
 Getter for the name of symbol of the function the user wants this specification to designate. More...
 
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 specification to designate. More...
 
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 specification to designate. More...
 
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 designate. More...
 
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 current specification to designate. More...
 
void set_allow_other_aliases (bool f)
 Setter for the "allow_other_aliases" property of the function suppression specification. More...
 
void set_change_kind (change_kind k)
 Setter of the "change-kind" property. More...
 
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. More...
 
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 specification to designate the negation of. More...
 
void set_name_regex_str (const string &)
 Setter for a regular expression for a family of names of functions the user wants the current specification to designate. More...
 
void set_parameter_specs (parameter_specs_type &)
 Setter for a vector of parameter specifications to specify properties of the parameters of the functions the user wants this specification to designate. More...
 
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. This property might be empty, in which case it's ignored at evaluation time. More...
 
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 current specification to designate. More...
 
void set_symbol_name (const string &n)
 Setter for the name of symbol of the function the user wants this specification to designate. More...
 
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 specification to designate. More...
 
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 specification to designate. More...
 
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 designate. More...
 
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 current specification to designate. 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_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 about a change involving this function_decl should be suppressed or not. More...
 
bool suppresses_function (const function_decl_sptr 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 about a change involving this function_decl should be suppressed or not. More...
 
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 about a change involving this elf_symbol should be suppressed or not. More...
 
bool suppresses_function_symbol (const elf_symbol_sptr 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 about a change involving this elf_symbol should be suppressed or not. More...
 
- Public Member Functions inherited from suppression_base
 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 &regexp)
 Setter for the "file_name_not_regex" property of the current instance of suppression_base. More...
 
void set_file_name_regex_str (const string &regexp)
 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 &regexp)
 Setter of the "soname_not_regex_str property of the current instance of suppression_base. More...
 
void set_soname_regex_str (const string &regexp)
 Setter of the "soname_regex_str property of the current instance of suppression_base. More...
 

Static Public Member Functions

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 function_suppression::change_kind as a result. More...
 

Public Attributes

std::unique_ptr< privpriv_
 
- Public Attributes inherited from suppression_base
std::unique_ptr< privpriv_
 

Detailed Description

Abstraction of a function suppression specification.

Specifies under which condition reports about a function_decl_diff diff node should be dropped on the floor for the purpose of reporting.

Definition at line 538 of file abg-suppression.h.

Member Typedef Documentation

◆ parameter_spec_sptr

typedef shared_ptr<parameter_spec> parameter_spec_sptr

Convenience typedef for shared_ptr of parameter_spec.

Definition at line 548 of file abg-suppression.h.

◆ parameter_specs_type

Convenience typedef for vector of parameter_spec_sptr.

Definition at line 551 of file abg-suppression.h.

Member Enumeration Documentation

◆ change_kind

The kind of change the current function suppression should apply to.

Enumerator
FUNCTION_SUBTYPE_CHANGE_KIND 

A change in a sub-type of the function.

ADDED_FUNCTION_CHANGE_KIND 

The function was added to the second subject of the diff.

DELETED_FUNCTION_CHANGE_KIND 

The function was deleted from the second subject of the diff.

ALL_CHANGE_KIND 

This represents all the changes possibly described by this enum. It's a logical 'OR' of all the change enumerators above.

Definition at line 555 of file abg-suppression.h.

Constructor & Destructor Documentation

◆ function_suppression() [1/2]

Default constructor for the function_suppression type.

It defines no suppression for now. Suppressions have to be specified by using the various accessors of the function_suppression type.

Definition at line 2520 of file abg-suppression.cc.

◆ function_suppression() [2/2]

function_suppression ( const string &  label,
const string &  name,
const string &  nr,
const string &  ret_tn,
const string &  ret_tr,
parameter_specs_type ps,
const string &  sym_n,
const string &  sym_nr,
const string &  sym_v,
const string &  sym_vr 
)

Constructor for the function_suppression type.

Parameters
labelan informative text string that the evalution code might use to designate this function suppression specification in error messages. This parameter might be empty, in which case it's ignored at evaluation time.
thename of the function the user wants the current specification to designate. This parameter might be empty, in which case it's ignored at evaluation time.
nrif name is empty this parameter is a regular expression for a family of names of functions the user wants the current specification to designate. If name is not empty, this parameter is ignored at specification evaluation time. This parameter might be empty, in which case it's ignored at evaluation time.
ret_tnthe name of the return type of the function the user wants this specification to designate. This parameter might be empty, in which case it's ignored at evaluation time.
ret_trif ret_tn is empty, then this is a regular expression for a family of return type names for functions the user wants the current specification to designate. If ret_tn is not empty, then this parameter is ignored at specification evaluation time. This parameter might be empty, in which case it's ignored at evaluation time.
psa vector of parameter specifications to specify properties of the parameters of the functions the user wants this specification to designate. This parameter might be empty, in which case it's ignored at evaluation time.
sym_nthe name of symbol of the function the user wants this specification to designate. This parameter might be empty, in which case it's ignored at evaluation time.
sym_nrif the parameter sym_n is empty, then this parameter is a regular expression for a family of names of symbols of functions the user wants this specification to designate. If the parameter sym_n is not empty, then this parameter is ignored at specification evaluation time. This parameter might be empty, in which case it's ignored at evaluation time.
sym_vthe name of the version of the symbol of the function the user wants this specification to designate. This parameter might be empty, in which case it's ignored at evaluation time.
sym_vrif the parameter sym_v is empty, then this parameter is a regular expression for a family of versions of symbols of functions the user wants the current specification to designate. If the parameter sym_v is non empty, then this parameter is ignored. This parameter might be empty, in which case it's ignored at evaluation time.

Definition at line 2579 of file abg-suppression.cc.

Member Function Documentation

◆ append_parameter_specs()

void append_parameter_specs ( const parameter_spec_sptr  p)

Append a specification of a parameter of the function specification.

Parameters
pthe parameter specification to add.

Definition at line 2768 of file abg-suppression.cc.

◆ get_allow_other_aliases()

bool get_allow_other_aliases ( ) const

Getter for the "allow_other_aliases" property of the function suppression specification.

Returns
the value of the "allow_other_aliases" property.

Definition at line 2921 of file abg-suppression.cc.

◆ get_change_kind()

function_suppression::change_kind get_change_kind ( ) const

Getter of the "change-kind" property.

Parameters
returnthe"change-kind" property.

Definition at line 2623 of file abg-suppression.cc.

◆ get_name()

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.

Returns
the name of the function.

Definition at line 2639 of file abg-suppression.cc.

◆ get_name_not_regex_str()

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 specification to designate the negation of.

Returns
the regular expression for the possible names of the function(s).

Definition at line 2676 of file abg-suppression.cc.

◆ get_name_regex_str()

const string & get_name_regex_str ( ) const

Getter for a regular expression for a family of names of functions the user wants the current specification to designate.

Returns
the regular expression for the possible names of the function(s).

Definition at line 2657 of file abg-suppression.cc.

◆ get_parameter_specs()

const function_suppression::parameter_specs_type & get_parameter_specs ( ) const

Getter for a vector of parameter specifications to specify properties of the parameters of the functions the user wants this specification to designate.

This property might be empty, in which case it's ignored at evaluation time.

Returns
the specifications of the parameters of the function(s).

Definition at line 2748 of file abg-suppression.cc.

◆ get_return_type_name()

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. This property might be empty, in which case it's ignored at evaluation time.

Returns
the name of the return type of the function.

Definition at line 2695 of file abg-suppression.cc.

◆ get_return_type_regex_str()

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 current specification to designate.

If the name of the return type of the function as returned by function_suppression::get_return_type_name() is not empty, then this property is ignored at specification evaluation time. This property might be empty, in which case it's ignored at evaluation time.

Returns
the regular expression for the possible names of the return types of the function(s).

Definition at line 2720 of file abg-suppression.cc.

◆ get_symbol_name()

const string & get_symbol_name ( ) const

Getter for the name of symbol of the function the user wants this specification to designate.

This property might be empty, in which case it's ignored at evaluation time.

Returns
name of the symbol of the function.

Definition at line 2779 of file abg-suppression.cc.

◆ get_symbol_name_not_regex_str()

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 specification to designate.

If a symbol name is matched by this regular expression, then the suppression specification will *NOT* suppress the symbol.

If the symbol name as returned by function_suppression::get_symbol_name() is not empty, then this property is ignored at specification evaluation time.

This property might be empty, in which case it's ignored at evaluation time.

Returns
the regular expression string for a family of names of symbols that is to be *NOT* suppressed by this suppression specification.

Definition at line 2841 of file abg-suppression.cc.

◆ get_symbol_name_regex_str()

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 specification to designate.

If the symbol name as returned by function_suppression::get_symbol_name() is not empty, then this property is ignored at specification evaluation time.

This property might be empty, in which case it's ignored at evaluation time.

Returns
the regular expression for a family of names of symbols of functions to designate.

Definition at line 2806 of file abg-suppression.cc.

◆ get_symbol_version()

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 designate.

This property might be empty, in which case it's ignored at evaluation time.

Returns
the symbol version of the function.

Definition at line 2872 of file abg-suppression.cc.

◆ get_symbol_version_regex_str()

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 current specification to designate.

If the symbol version as returned by function_suppression::get_symbol_version() is non empty, then this property is ignored. This property might be empty, in which case it's ignored at evaluation time.

Returns
the regular expression for the versions of symbols of functions to designate.

Definition at line 2898 of file abg-suppression.cc.

◆ parse_change_kind()

function_suppression::change_kind parse_change_kind ( const string &  s)
static

Parses a string containing the content of the "change-kind" property and returns the an instance of function_suppression::change_kind as a result.

Parameters
sthe string to parse.
Returns
the resulting function_suppression::change_kind.

Definition at line 2605 of file abg-suppression.cc.

◆ set_allow_other_aliases()

void set_allow_other_aliases ( bool  f)

Setter for the "allow_other_aliases" property of the function suppression specification.

Parameters
fthe new value of the property.

Definition at line 2929 of file abg-suppression.cc.

◆ set_change_kind()

void set_change_kind ( change_kind  k)

Setter of the "change-kind" property.

Parameters
kthe new value of the change_kind property.

Definition at line 2630 of file abg-suppression.cc.

◆ set_name()

void set_name ( const string &  n)

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.

Parameters
nthe new function name to set.

Definition at line 2648 of file abg-suppression.cc.

◆ set_name_not_regex_str()

void set_name_not_regex_str ( const string &  r)

Setter for a regular expression for a family of names of functions the user wants the current specification to designate the negation of.

Parameters
rthe new the regular expression for the possible names of the function(s).

Definition at line 2686 of file abg-suppression.cc.

◆ set_name_regex_str()

void set_name_regex_str ( const string &  r)

Setter for a regular expression for a family of names of functions the user wants the current specification to designate.

Parameters
rthe new the regular expression for the possible names of the function(s).

Definition at line 2666 of file abg-suppression.cc.

◆ set_parameter_specs()

void set_parameter_specs ( parameter_specs_type p)

Setter for a vector of parameter specifications to specify properties of the parameters of the functions the user wants this specification to designate.

This property might be empty, in which case it's ignored at evaluation time.

Parameters
pthe new specifications of the parameters of the function(s) to set.

Definition at line 2761 of file abg-suppression.cc.

◆ set_return_type_name()

void set_return_type_name ( const string &  tr)

Setter for the name of the return type of the function the user wants this specification to designate. This property might be empty, in which case it's ignored at evaluation time.

Parameters
trthe new name of the return type of the function to set.

Definition at line 2704 of file abg-suppression.cc.

◆ set_return_type_regex_str()

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 current specification to designate.

If the name of the return type of the function as returned by function_suppression::get_return_type_name() is not empty, then this property is ignored at specification evaluation time. This property might be empty, in which case it's ignored at evaluation time.

Parameters
rthe new regular expression for the possible names of the return types of the function(s) to set.

Definition at line 2736 of file abg-suppression.cc.

◆ set_symbol_name()

void set_symbol_name ( const string &  n)

Setter for the name of symbol of the function the user wants this specification to designate.

This property might be empty, in which case it's ignored at evaluation time.

Returns
name of the symbol of the function.

Definition at line 2790 of file abg-suppression.cc.

◆ set_symbol_name_not_regex_str()

void set_symbol_name_not_regex_str ( const string &  r)

Setter for a regular expression for a family of names of symbols of functions the user wants this specification to designate.

If a symbol name is matched by this regular expression, then the suppression specification will *NOT* suppress the symbol.

If the symbol name as returned by function_suppression::get_symbol_name() is not empty, then this property is ignored at specification evaluation time.

This property might be empty, in which case it's ignored at evaluation time.

Parameters
thenew regular expression string for a family of names of symbols that is to be *NOT* suppressed by this suppression specification.

Definition at line 2861 of file abg-suppression.cc.

◆ set_symbol_name_regex_str()

void set_symbol_name_regex_str ( const string &  r)

Setter for a regular expression for a family of names of symbols of functions the user wants this specification to designate.

If the symbol name as returned by function_suppression::get_symbol_name() is not empty, then this property is ignored at specification evaluation time.

This property might be empty, in which case it's ignored at evaluation time.

Parameters
rthe new regular expression for a family of names of symbols of functions to set.

Definition at line 2822 of file abg-suppression.cc.

◆ set_symbol_version()

void set_symbol_version ( const string &  v)

Setter for the name of the version of the symbol of the function the user wants this specification to designate.

This property might be empty, in which case it's ignored at evaluation time.

Parameters
vthe new symbol version of the function.

Definition at line 2883 of file abg-suppression.cc.

◆ set_symbol_version_regex_str()

void set_symbol_version_regex_str ( const string &  r)

Setter for a regular expression for a family of versions of symbols of functions the user wants the current specification to designate.

If the symbol version as returned by function_suppression::get_symbol_version() is non empty, then this property is ignored. This property might be empty, in which case it's ignored at evaluation time.

Parameters
thenew regular expression for the versions of symbols of functions to designate.

Definition at line 2913 of file abg-suppression.cc.

◆ suppresses_diff()

bool suppresses_diff ( const diff diff) const
virtual

Evaluate this suppression specification on a given diff node and say if the diff node should be suppressed or not.

Parameters
diffthe diff node to evaluate this suppression specification against.
Returns
true if diff should be suppressed.

Implements suppression_base.

Definition at line 2940 of file abg-suppression.cc.

◆ suppresses_function() [1/2]

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 about a change involving this function_decl should be suppressed or not.

Parameters
fnthe function_decl to evaluate this suppression specification against.
kthe kind of function change fn is supposed to have.
ctxtthe context of the current diff.
Returns
true iff a report about a change involving the function fn should be suppressed.

Definition at line 2972 of file abg-suppression.cc.

◆ suppresses_function() [2/2]

bool suppresses_function ( const function_decl_sptr  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 about a change involving this function_decl should be suppressed or not.

Parameters
fnthe function_decl to evaluate this suppression specification against.
kthe kind of function change fn is supposed to have.
ctxtthe context of the current diff.
Returns
true iff a report about a change involving the function fn should be suppressed.

Definition at line 3256 of file abg-suppression.cc.

◆ suppresses_function_symbol() [1/2]

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 about a change involving this elf_symbol should be suppressed or not.

Parameters
symthe elf_symbol to evaluate this suppression specification against.
kthe kind of function change sym is supposed to have.
ctxtthe context of the current diff.
Returns
true iff a report about a change involving the symbol sym should be suppressed.

Definition at line 3275 of file abg-suppression.cc.

◆ suppresses_function_symbol() [2/2]

bool suppresses_function_symbol ( const elf_symbol_sptr  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 about a change involving this elf_symbol should be suppressed or not.

Parameters
symthe elf_symbol to evaluate this suppression specification against.
kthe kind of function change sym is supposed to have.
ctxtthe context of the current diff.
Returns
true iff a report about a change involving the symbol sym should be suppressed.

Definition at line 3363 of file abg-suppression.cc.


The documentation for this class was generated from the following files: