libabigail
Loading...
Searching...
No Matches
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 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 exported_decls_builder.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
bool maybe_add_var_to_exported_vars (const var_decl_sptr &)
 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.
 

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 336 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 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 77 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 111 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 102 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 151 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 142 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 126 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 163 of file abg-corpus.cc.

◆ maybe_add_var_to_exported_vars()

bool maybe_add_var_to_exported_vars ( const var_decl_sptr & 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 193 of file abg-corpus.cc.

Friends And Related Symbol Documentation

◆ corpus

friend class corpus
friend

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

Member Data Documentation

◆ priv_

std::unique_ptr<priv> priv_

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


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