libabigail
Classes | Public Member Functions | Public Attributes | Friends | List of all members
corpus::exported_decls_builder Class Reference

Abstracts the building of the set of exported variables and functions. More...

#include <abg-corpus.h>

Classes

class  priv
 The type of the private data of corpus::exported_decls_builder type. More...
 

Public Member Functions

 exported_decls_builder (functions &fns, variables &vars, strings_type &fns_suppress_regexps, strings_type &vars_suppress_regexps, strings_type &fns_keep_regexps, strings_type &vars_keep_regexps, strings_type &sym_id_of_fns_to_keep, strings_type &sym_id_of_vars_to_keep)
 Constructor of corpus::exported_decls_builder. More...
 
functionsexported_functions ()
 Getter for the reference to the vector of exported functions. This vector is shared with with the corpus. It's where the set of exported function is ultimately stored. More...
 
const functionsexported_functions () const
 Getter for the reference to the vector of exported functions. This vector is shared with with the corpus. It's where the set of exported function is ultimately stored. More...
 
variablesexported_variables ()
 Getter for the reference to the vector of exported variables. This vector is shared with with the corpus. It's where the set of exported variable is ultimately stored. More...
 
const variablesexported_variables () const
 Getter for the reference to the vector of exported variables. This vector is shared with with the corpus. It's where the set of exported variable is ultimately stored. More...
 
std::unordered_set< function_decl * > * fn_id_maps_to_several_fns (const function_decl *)
 Test if a given function ID maps to several functions in the same corpus. More...
 
bool maybe_add_fn_to_exported_fns (function_decl *)
 Consider at all the tunables that control wether a function should be added to the set of exported function and if it fits in, add the function to that set. More...
 
bool maybe_add_var_to_exported_vars (const var_decl *)
 Consider at all the tunables that control wether a variable should be added to the set of exported variable and if it fits in, add the variable to that set. More...
 

Public Attributes

std::unique_ptr< privpriv_
 

Friends

class corpus
 

Detailed Description

Abstracts the building of the set of exported variables and functions.

Given a function or variable, this type can decide if it belongs to the list of exported functions and variables based on all the parameters needed.

Definition at line 333 of file abg-corpus.h.

Constructor & Destructor Documentation

◆ exported_decls_builder()

exported_decls_builder ( functions fns,
variables vars,
strings_type fns_suppress_regexps,
strings_type vars_suppress_regexps,
strings_type fns_keep_regexps,
strings_type vars_keep_regexps,
strings_type sym_id_of_fns_to_keep,
strings_type sym_id_of_vars_to_keep 
)

Constructor of corpus::exported_decls_builder.

Parameters
fnsa reference to the vector of exported functions.
varsa reference to the vector of exported variables.
fns_suppress_regexpsthe regular expressions that designate the functions to suppress from the exported functions set.
vars_suppress_regexpsthe regular expressions that designate the variables to suppress from the exported variables set.
fns_keep_regexpsthe regular expressions that designate the functions to keep in the exported functions set.
fns_keep_regexpsthe regular expressions that designate the functions to keep in the exported functions set.
vars_keep_regexpsthe regular expressions that designate the variables to keep in the exported variables set.
sym_id_of_fns_to_keepthe IDs of the functions to keep in the exported functions set.
sym_id_of_vars_to_keepthe IDs of the variables to keep in the exported variables set.

Definition at line 76 of file abg-corpus.cc.

Member Function Documentation

◆ exported_functions() [1/2]

corpus::functions & exported_functions ( )

Getter for the reference to the vector of exported functions. This vector is shared with with the corpus. It's where the set of exported function is ultimately stored.

Returns
a reference to the vector of exported functions.

Definition at line 110 of file abg-corpus.cc.

◆ exported_functions() [2/2]

const corpus::functions & exported_functions ( ) const

Getter for the reference to the vector of exported functions. This vector is shared with with the corpus. It's where the set of exported function is ultimately stored.

Returns
a reference to the vector of exported functions.

Definition at line 101 of file abg-corpus.cc.

◆ exported_variables() [1/2]

corpus::variables & exported_variables ( )

Getter for the reference to the vector of exported variables. This vector is shared with with the corpus. It's where the set of exported variable is ultimately stored.

Returns
a reference to the vector of exported variables.

Definition at line 150 of file abg-corpus.cc.

◆ exported_variables() [2/2]

const corpus::variables & exported_variables ( ) const

Getter for the reference to the vector of exported variables. This vector is shared with with the corpus. It's where the set of exported variable is ultimately stored.

Returns
a reference to the vector of exported variables.

Definition at line 141 of file abg-corpus.cc.

◆ fn_id_maps_to_several_fns()

std::unordered_set< function_decl * > * fn_id_maps_to_several_fns ( const function_decl fn)

Test if a given function ID maps to several functions in the same corpus.

The magic of ELF symbol aliases makes it possible for an ELF symbol alias to designate several different functions. This function tests if the ELF symbol of a given function has a aliases that designates another function or not.

Parameters
fnthe function to consider.
Returns
the set of functions designated by the ELF symbol of fn, or nullptr if the function ID maps to just fn.

Definition at line 125 of file abg-corpus.cc.

◆ maybe_add_fn_to_exported_fns()

bool maybe_add_fn_to_exported_fns ( function_decl fn)

Consider at all the tunables that control wether a function should be added to the set of exported function and if it fits in, add the function to that set.

Parameters
fnthe function to add the set of exported functions.
Returns
true iff the function was added to the set of exported functions.

Definition at line 162 of file abg-corpus.cc.

◆ maybe_add_var_to_exported_vars()

bool maybe_add_var_to_exported_vars ( const var_decl var)

Consider at all the tunables that control wether a variable should be added to the set of exported variable and if it fits in, add the variable to that set.

Parameters
fnthe variable to add the set of exported variables.
Returns
true iff the variable was added to the set of exported variables.

Definition at line 192 of file abg-corpus.cc.


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