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. More... | |
typedef vector< parameter_spec_sptr > | parameter_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_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. 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... | |
![]() | |
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... | |
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< priv > | priv_ |
![]() | |
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 499 of file abg-suppression.h.
typedef shared_ptr<parameter_spec> parameter_spec_sptr |
Convenience typedef for shared_ptr of parameter_spec.
Definition at line 509 of file abg-suppression.h.
typedef vector<parameter_spec_sptr> parameter_specs_type |
Convenience typedef for vector of parameter_spec_sptr.
Definition at line 512 of file abg-suppression.h.
enum change_kind |
The kind of change the current function suppression should apply to.
Definition at line 516 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 2307 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 2366 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 2555 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 2708 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 2410 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 2426 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 2463 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 2444 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 2535 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 2482 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 2507 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 2566 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 2628 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 2593 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 2659 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 2685 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 2392 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 2716 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 2417 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 2435 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 2473 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 2453 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 2548 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 2491 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 2523 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 2577 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 2648 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 2609 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 2670 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 2700 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 2727 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 2759 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 3043 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 3062 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 3150 of file abg-suppression.cc.