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

The abstraction of a variable suppression specification. More...

#include <abg-suppression.h>

Inheritance diagram for variable_suppression:
[legend]

Classes

struct  priv
 The type of the private data of the variable_suppression type. More...
 

Public Types

enum  change_kind {
  UNDEFINED_CHANGE_KIND , VARIABLE_SUBTYPE_CHANGE_KIND , ADDED_VARIABLE_CHANGE_KIND , DELETED_VARIABLE_CHANGE_KIND ,
  ALL_CHANGE_KIND
}
 The kind of change the current variable suppression should apply to. More...
 

Public Member Functions

 variable_suppression (const string &label="", const string &name="", const string &name_regex_str="", const string &symbol_name="", const string &symbol_name_regex_str="", const string &symbol_version="", const string &symbol_version_regex_str="", const string &type_name="", const string &type_name_regex_str="")
 Constructor for the variable_suppression type. More...
 
virtual ~variable_suppression ()
 Virtual destructor for the @erf variable_suppression type. variable_suppression type. More...
 
change_kind get_change_kind () const
 Getter of the "change_king" property. More...
 
const string & get_name () const
 Getter for the name of the variable the user wants the current specification to designate. This property might be empty, in which case it's ignored at evaluation time. More...
 
const string & get_name_not_regex_str () const
 Getter for the "name_not_regexp" property of the specification. More...
 
const string & get_name_regex_str () const
 Getter for the regular expression for a family of names of variables the user wants the current specification to designate. If the variable name as returned by variable_suppression::get_name() is not empty, then this property is ignored at evaluation time. This property might be empty, in which case it's ignored at evaluation time. More...
 
const string & get_symbol_name () const
 Getter for the name of the symbol of the variable the user wants the current 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 variables the user wants this specification to designate. More...
 
const string & get_symbol_name_regex_str () const
 Getter of the regular expression for a family of symbol names of the variables this specification is about to designate. More...
 
const string & get_symbol_version () const
 Getter for the version of the symbol of the variable the user wants the current specification to designate. This property might be empty, in which case it's ignored at evaluation time. More...
 
const string & get_symbol_version_regex_str () const
 Getter of the regular expression for a family of versions of symbol for the variables the user wants the current specification to designate. If symbol_version is not empty, then this property is ignored at evaluation time. This property might be empty, in which case it's ignored at evaluation time. More...
 
const string & get_type_name () const
 Getter for the name of the type of the variable the user wants the current specification to designate. More...
 
const string & get_type_name_regex_str () const
 Getter for the regular expression for a family of type names of variables the user wants the current specification to designate. 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 variable the user wants the current specification to designate. This property might be empty, in which case it's ignored at evaluation time. More...
 
void set_name_not_regex_str (const string &)
 Setter for the "name_not_regexp" property of the specification. More...
 
void set_name_regex_str (const string &)
 Setter for the regular expression for a family of names of variables the user wants the current specification to designate. If the variable name as returned by variable_suppression::get_name() is not empty, then this property is ignored at evaluation time. This property might be empty, in which case it's ignored at evaluation time. More...
 
void set_symbol_name (const string &)
 Setter for the name of the symbol of the variable the user wants the current 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 variables the user wants this specification to designate. More...
 
void set_symbol_name_regex_str (const string &)
 Setter of the regular expression for a family of symbol names of the variables this specification is about to designate. More...
 
void set_symbol_version (const string &)
 Setter for the version of the symbol of the variable the user wants the current specification to designate. This property might be empty, in which case it's ignored at evaluation time. More...
 
void set_symbol_version_regex_str (const string &)
 Setter of the regular expression for a family of versions of symbol for the variables the user wants the current specification to designate. If symbol_version is not empty, then this property is ignored at evaluation time. This property might be empty, in which case it's ignored at evaluation time. More...
 
void set_type_name (const string &)
 Setter for the name of the type of the variable the user wants the current specification to designate. More...
 
void set_type_name_regex_str (const string &)
 Setter for the regular expression for a family of type names of variables the user wants the current specification to designate. More...
 
bool suppresses_diff (const diff *d) const
 Evaluate this suppression specification on a given diff node and say if the diff node should be suppressed or not. More...
 
bool suppresses_variable (const var_decl *var, change_kind k, const diff_context_sptr cxt) const
 Evaluate the current variable suppression specification on a given var_decl and say if a report about a change involving this var_decl should be suppressed or not. More...
 
bool suppresses_variable (const var_decl_sptr var, change_kind k, const diff_context_sptr cxt) const
 Evaluate the current variable suppression specification on a given var_decl and say if a report about a change involving this var_decl should be suppressed or not. More...
 
bool suppresses_variable_symbol (const elf_symbol *sym, change_kind k, const diff_context_sptr cxt) const
 Evaluate the current variable 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_variable_symbol (const elf_symbol_sptr fn, change_kind k, const diff_context_sptr cxt) const
 Evaluate the current variable 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 variable_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

The abstraction of a variable suppression specification.

It specifies under which condition reports about a var_diff diff node should be dropped on the floor for the purpose of reporting.

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

Member Enumeration Documentation

◆ change_kind

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

Enumerator
VARIABLE_SUBTYPE_CHANGE_KIND 

A change in a sub-type of the variable.

ADDED_VARIABLE_CHANGE_KIND 

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

DELETED_VARIABLE_CHANGE_KIND 

The variable 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 757 of file abg-suppression.h.

Constructor & Destructor Documentation

◆ variable_suppression()

variable_suppression ( const string &  label = "",
const string &  name = "",
const string &  name_regex_str = "",
const string &  symbol_name = "",
const string &  symbol_name_regex_str = "",
const string &  symbol_version = "",
const string &  symbol_version_regex = "",
const string &  type_name = "",
const string &  type_name_regex_str = "" 
)

Constructor for the variable_suppression type.

Parameters
labelan informative text string that the evalution code might use to designate this variable suppression specification in error messages. This parameter might be empty, in which case it's ignored at evaluation time.
namethe name of the variable the user wants the current specification to designate. This parameter might be empty, in which case it's ignored at evaluation time.
name_regex_strif name is empty, this parameter is a regular expression for a family of names of variables the user wants the current specification to designate. If name is not empty, then this parameter is ignored at evaluation time. This parameter might be empty, in which case it's ignored at evaluation time.
symbol_namethe name of the symbol of the variable the user wants the current specification to designate. This parameter might be empty, in which case it's ignored at evaluation time.
symbol_name_strif symbol_name is empty, this parameter is a regular expression for a family of names of symbols of variables the user wants the current specification to designate. If symbol_name is not empty, then this parameter is ignored at evaluation time. This parameter might be empty, in which case it's ignored at evaluation time.
symbol_versionthe version of the symbol of the variable the user wants the current specification to designate. This parameter might be empty, in which case it's ignored at evaluation time.
symbol_version_regexif symbol_version is empty, then this parameter is a regular expression for a family of versions of symbol for the variables the user wants the current specification to designate. If symbol_version is not empty, then this parameter is ignored at evaluation time. This parameter might be empty, in which case it's ignored at evaluation time.
type_namethe name of the type of the variable the user wants the current specification to designate. This parameter might be empty, in which case it's ignored at evaluation time.
type_name_regex_strif type_name is empty, then this parameter is a regular expression for a family of type names of variables the user wants the current specification to designate. If type_name is not empty, then this parameter is ignored at evluation time. This parameter might be empty, in which case it's ignored at evaluation time.

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

◆ ~variable_suppression()

~variable_suppression ( )
virtual

Virtual destructor for the @erf variable_suppression type. variable_suppression type.

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

Member Function Documentation

◆ get_change_kind()

variable_suppression::change_kind get_change_kind ( ) const

Getter of the "change_king" property.

Returns
the value of the "change_kind" property.

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

◆ get_name()

const string & get_name ( ) const

Getter for the name of the variable the user wants the current specification to designate. This property might be empty, in which case it's ignored at evaluation time.

Returns
the name of the variable.

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

◆ get_name_not_regex_str()

const string & get_name_not_regex_str ( ) const

Getter for the "name_not_regexp" property of the specification.

Returns
the value of the "name_not_regexp" property.

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

◆ get_name_regex_str()

const string & get_name_regex_str ( ) const

Getter for the regular expression for a family of names of variables the user wants the current specification to designate. If the variable name as returned by variable_suppression::get_name() is not empty, then this property is ignored at evaluation time. This property might be empty, in which case it's ignored at evaluation time.

Returns
the regular expression for the variable name.

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

◆ get_symbol_name()

const string & get_symbol_name ( ) const

Getter for the name of the symbol of the variable the user wants the current specification to designate.

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

Returns
the name of the symbol of the variable.

Definition at line 3928 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 variables 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 variable_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 3984 of file abg-suppression.cc.

◆ get_symbol_name_regex_str()

const string & get_symbol_name_regex_str ( ) const

Getter of the regular expression for a family of symbol names of the variables this specification is about to designate.

This property might be empty, in which case it's ignored at evaluation time. Otherwise, it is taken in account iff the property returned by variable_suppression::get_symbol_name() is empty.

Returns
the regular expression for a symbol name of the variable.

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

◆ get_symbol_version()

const string & get_symbol_version ( ) const

Getter for the version of the symbol of the variable the user wants the current specification to designate. This property might be empty, in which case it's ignored at evaluation time.

Returns
the symbol version of the variable.

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

◆ get_symbol_version_regex_str()

const string & get_symbol_version_regex_str ( ) const

Getter of the regular expression for a family of versions of symbol for the variables the user wants the current specification to designate. If symbol_version is not empty, then this property is ignored at evaluation time. This property might be empty, in which case it's ignored at evaluation time.

Returns
the regular expression of the symbol version of the variable.

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

◆ get_type_name()

const string & get_type_name ( ) const

Getter for the name of the type of the variable the user wants the current specification to designate.

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

Returns
the name of the variable type.

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

◆ get_type_name_regex_str()

const string & get_type_name_regex_str ( ) const

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

If the type name as returned by variable_suppression::get_type_name() is not empty, then this property is ignored at evaluation time. This property might be empty, in which case it's ignored at evaluation time.

Returns
the regular expression of the variable type name.

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

◆ parse_change_kind()

variable_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 variable_suppression::change_kind as a result.

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

Definition at line 3836 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 of the change_kind.

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

◆ set_name()

void set_name ( const string &  n)

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

Parameters
nthe new name of the variable to set.

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

◆ set_name_not_regex_str()

void set_name_not_regex_str ( const string &  r)

Setter for the "name_not_regexp" property of the specification.

Parameters
rthe new value of the "name_not_regexp" property.

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

◆ set_name_regex_str()

void set_name_regex_str ( const string &  r)

Setter for the regular expression for a family of names of variables the user wants the current specification to designate. If the variable name as returned by variable_suppression::get_name() is not empty, then this property is ignored at evaluation time. This property might be empty, in which case it's ignored at evaluation time.

Parameters
rthe new regular expression for the variable name.

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

◆ set_symbol_name()

void set_symbol_name ( const string &  n)

Setter for the name of the symbol of the variable the user wants the current specification to designate.

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

Parameters
nthe new name of the symbol of the variable.

Definition at line 3939 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 variables 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 variable_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 4004 of file abg-suppression.cc.

◆ set_symbol_name_regex_str()

void set_symbol_name_regex_str ( const string &  r)

Setter of the regular expression for a family of symbol names of the variables this specification is about to designate.

This property might be empty, in which case it's ignored at evaluation time. Otherwise, it is taken in account iff the property returned by variable_suppression::get_symbol_name() is empty.

Parameters
rthe regular expression for a symbol name of the variable.

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

◆ set_symbol_version()

void set_symbol_version ( const string &  v)

Setter for the version of the symbol of the variable the user wants the current specification to designate. This property might be empty, in which case it's ignored at evaluation time.

Returns
the new symbol version of the variable.

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

◆ set_symbol_version_regex_str()

void set_symbol_version_regex_str ( const string &  r)

Setter of the regular expression for a family of versions of symbol for the variables the user wants the current specification to designate. If symbol_version is not empty, then this property is ignored at evaluation time. This property might be empty, in which case it's ignored at evaluation time.

Parameters
vthe new regular expression of the symbol version of the variable.

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

◆ set_type_name()

void set_type_name ( const string &  n)

Setter for the name of the type of the variable the user wants the current specification to designate.

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

Parameters
nthe new name of the variable type.

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

◆ set_type_name_regex_str()

void set_type_name_regex_str ( const string &  r)

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

If the type name as returned by variable_suppression::get_type_name() is not empty, then this property is ignored at evaluation time. This property might be empty, in which case it's ignored at evaluation time.

Parameters
rthe regular expression of the variable type name.

Definition at line 4094 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 4105 of file abg-suppression.cc.

◆ suppresses_variable() [1/2]

bool suppresses_variable ( const var_decl var,
change_kind  k,
const diff_context_sptr  ctxt 
) const

Evaluate the current variable suppression specification on a given var_decl and say if a report about a change involving this var_decl should be suppressed or not.

Parameters
varthe var_decl to evaluate this suppression specification against.
kthe kind of variable change var is supposed to have.
ctxtthe context of the current diff.
Returns
true iff a report about a change involving the variable var should be suppressed.

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

◆ suppresses_variable() [2/2]

bool suppresses_variable ( const var_decl_sptr  var,
change_kind  k,
const diff_context_sptr  ctxt 
) const

Evaluate the current variable suppression specification on a given var_decl and say if a report about a change involving this var_decl should be suppressed or not.

Parameters
varthe var_decl to evaluate this suppression specification against.
kthe kind of variable change var is supposed to have.
ctxtthe context of the current diff.
Returns
true iff a report about a change involving the variable var should be suppressed.

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

◆ suppresses_variable_symbol() [1/2]

bool suppresses_variable_symbol ( const elf_symbol sym,
change_kind  k,
const diff_context_sptr  ctxt 
) const

Evaluate the current variable 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 variable 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 4277 of file abg-suppression.cc.

◆ suppresses_variable_symbol() [2/2]

bool suppresses_variable_symbol ( const elf_symbol_sptr  sym,
change_kind  k,
const diff_context_sptr  ctxt 
) const

Evaluate the current variable 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 variable 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 4370 of file abg-suppression.cc.


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