libabigail
|
Abstraction of a function suppression specification. More...
#include <abg-suppression.h>
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_spec > | parameter_spec_sptr |
Convenience typedef for shared_ptr of parameter_spec. | |
typedef vector< parameter_spec_sptr > | parameter_specs_type |
Convenience typedef for vector of parameter_spec_sptr. | |
Public Member Functions | |
function_suppression () | |
Default constructor for the function_suppression type. | |
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. | |
void | append_parameter_specs (const parameter_spec_sptr) |
Append a specification of a parameter of the function specification. | |
bool | get_allow_other_aliases () const |
Getter for the "allow_other_aliases" property of the function suppression specification. | |
change_kind | get_change_kind () const |
Getter of the "change-kind" property. | |
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. | |
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. | |
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. | |
const 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. | |
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. | |
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. | |
const string & | get_symbol_name () const |
Getter for the name of symbol of the function the user wants this specification to designate. | |
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. | |
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. | |
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. | |
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. | |
void | set_allow_other_aliases (bool f) |
Setter for the "allow_other_aliases" property of the function suppression specification. | |
void | set_change_kind (change_kind k) |
Setter of the "change-kind" property. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
void | set_symbol_name (const string &n) |
Setter for the name of symbol of the function the user wants this specification to designate. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
Public Member Functions inherited from suppression_base | |
suppression_base (const string &label) | |
Constructor for suppression_base. | |
suppression_base (const string &label, const string &file_name_regex_str, const string &file_name_not_regex_str) | |
Constructor for suppression_base. | |
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. | |
const string & | get_file_name_not_regex_str () const |
Getter for the "file_name_not_regex" property of the current instance of suppression_base. | |
const string & | get_file_name_regex_str () const |
Getter for the "file_name_regex" property of the current instance of suppression_base. | |
bool | get_is_artificial () const |
Test is the suppression specification is artificial. | |
const string | get_label () const |
Getter for the label associated to this suppression specification. | |
const string & | get_soname_not_regex_str () const |
Getter of the "soname_not_regex_str property of the current instance of suppression_base. | |
const string & | get_soname_regex_str () const |
Getter of the "soname_regex_str property of the current instance of suppression_base. | |
bool | has_file_name_related_property () const |
Test if the current suppression has a property related to file name. | |
bool | has_soname_related_property () const |
Test if the current suppression has a property related to SONAMEs. | |
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. | |
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. | |
void | set_file_name_regex_str (const string ®exp) |
Setter for the "file_name_regex" property of the current instance of suppression_base. | |
void | set_is_artificial (bool) |
Set a flag saying if the suppression specification is artificial or not. | |
void | set_label (const string &) |
Setter for the label associated to this suppression specification. | |
void | set_soname_not_regex_str (const string ®exp) |
Setter of the "soname_not_regex_str property of the current instance of suppression_base. | |
void | set_soname_regex_str (const string ®exp) |
Setter of the "soname_regex_str property of the current instance of suppression_base. | |
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. | |
Public Attributes | |
std::unique_ptr< priv > | priv_ |
Public Attributes inherited from suppression_base | |
std::unique_ptr< priv > | priv_ |
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.
shared_ptr<parameter_spec> parameter_spec_sptr |
Convenience typedef for shared_ptr of parameter_spec.
Definition at line 548 of file abg-suppression.h.
Convenience typedef for vector of parameter_spec_sptr.
Definition at line 551 of file abg-suppression.h.
enum change_kind |
The kind of change the current function suppression should apply to.
Definition at line 555 of file abg-suppression.h.
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 | ( | 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.
label | an 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. |
the | name 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. |
nr | if 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_tn | the 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_tr | if 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. |
ps | a 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_n | the 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_nr | if 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_v | the 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_vr | if 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.
|
virtual |
Definition at line 2594 of file abg-suppression.cc.
void append_parameter_specs | ( | const parameter_spec_sptr | p | ) |
Append a specification of a parameter of the function specification.
p | the parameter specification to add. |
Definition at line 2768 of file abg-suppression.cc.
bool get_allow_other_aliases | ( | ) | const |
Getter for the "allow_other_aliases" property of the function suppression specification.
Definition at line 2921 of file abg-suppression.cc.
function_suppression::change_kind get_change_kind | ( | ) | const |
Getter of the "change-kind" property.
returnthe | "change-kind" property. |
Definition at line 2623 of file abg-suppression.cc.
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.
Definition at line 2639 of file abg-suppression.cc.
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.
Definition at line 2676 of file abg-suppression.cc.
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.
Definition at line 2657 of file abg-suppression.cc.
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.
Definition at line 2748 of file abg-suppression.cc.
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.
Definition at line 2695 of file abg-suppression.cc.
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.
Definition at line 2720 of file abg-suppression.cc.
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.
Definition at line 2779 of file abg-suppression.cc.
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.
Definition at line 2841 of file abg-suppression.cc.
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.
Definition at line 2806 of file abg-suppression.cc.
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.
Definition at line 2872 of file abg-suppression.cc.
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.
Definition at line 2898 of file abg-suppression.cc.
|
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.
s | the string to parse. |
Definition at line 2605 of file abg-suppression.cc.
void set_allow_other_aliases | ( | bool | f | ) |
Setter for the "allow_other_aliases" property of the function suppression specification.
f | the new value of the property. |
Definition at line 2929 of file abg-suppression.cc.
void set_change_kind | ( | change_kind | k | ) |
Setter of the "change-kind" property.
k | the new value of the change_kind property. |
Definition at line 2630 of file abg-suppression.cc.
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.
n | the new function name to set. |
Definition at line 2648 of file abg-suppression.cc.
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.
r | the new the regular expression for the possible names of the function(s). |
Definition at line 2686 of file abg-suppression.cc.
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.
r | the new the regular expression for the possible names of the function(s). |
Definition at line 2666 of file abg-suppression.cc.
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.
p | the new specifications of the parameters of the function(s) to set. |
Definition at line 2761 of file abg-suppression.cc.
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.
tr | the new name of the return type of the function to set. |
Definition at line 2704 of file abg-suppression.cc.
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.
r | the 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.
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.
Definition at line 2790 of file abg-suppression.cc.
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.
the | new 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.
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.
r | the new regular expression for a family of names of symbols of functions to set. |
Definition at line 2822 of file abg-suppression.cc.
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.
v | the new symbol version of the function. |
Definition at line 2883 of file abg-suppression.cc.
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.
the | new regular expression for the versions of symbols of functions to designate. |
Definition at line 2913 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.
Definition at line 2940 of file abg-suppression.cc.
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.
fn | the function_decl to evaluate this suppression specification against. |
k | the kind of function change fn is supposed to have. |
ctxt | the context of the current diff. |
fn
should be suppressed. Definition at line 2972 of file abg-suppression.cc.
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.
fn | the function_decl to evaluate this suppression specification against. |
k | the kind of function change fn is supposed to have. |
ctxt | the context of the current diff. |
fn
should be suppressed. Definition at line 3256 of file abg-suppression.cc.
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.
sym | the elf_symbol to evaluate this suppression specification against. |
k | the kind of function change sym is supposed to have. |
ctxt | the context of the current diff. |
sym
should be suppressed. Definition at line 3275 of file abg-suppression.cc.
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.
sym | the elf_symbol to evaluate this suppression specification against. |
k | the kind of function change sym is supposed to have. |
ctxt | the context of the current diff. |
sym
should be suppressed. Definition at line 3363 of file abg-suppression.cc.
std::unique_ptr<priv> priv_ |
Definition at line 544 of file abg-suppression.h.