libabigail
Public Member Functions | Static Public Member Functions | Friends | List of all members
corpus::exported_decls_builder::priv Class Reference

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

#include <abg-corpus-priv.h>

Public Member Functions

 priv (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)
 
void add_fn_to_exported (function_decl *fn)
 Add a function to the set of exported functions. More...
 
void add_fn_to_id_fns_map (function_decl *fn)
 Add a given function to the map of functions that are present in the set of exported functions. More...
 
void add_var_to_exported (const var_decl *var)
 Add a variable to the set of exported variables. More...
 
void add_var_to_map (var_decl *var)
 Add a given variable to the map of functions that are present in the set of exported functions. More...
 
regex_t_sptrs_typecompiled_regex_fns_keep ()
 Getter for the compiled regular expressions that designates the functions to keep in the set of exported functions. More...
 
regex_t_sptrs_typecompiled_regex_fns_suppress ()
 Getter for the compiled regular expressions that designate the functions to suppress from the set of exported functions. More...
 
regex_t_sptrs_typecompiled_regex_vars_keep ()
 Getter for the compiled regular expressions that designate the variables to keep in the set of exported variables. More...
 
regex_t_sptrs_typecompiled_regex_vars_suppress ()
 Getter of the compiled regular expressions that designate the variables to suppress from the set of exported variables. More...
 
std::unordered_set< function_decl * > * fn_id_is_in_id_fns_map (const function_decl *fn)
 Test if a a function if the same ID as a given function is present in the id-functions map. More...
 
std::unordered_set< function_decl * > * fn_id_is_in_id_fns_map (const interned_string &fn_id)
 Test if a given function ID is in the id-functions map. More...
 
bool fn_is_in_id_fns_map (function_decl *fn)
 Test if a function is in the id-functions map. More...
 
interned_string get_id (const function_decl &fn)
 Returns an ID for a given function. More...
 
interned_string get_id (const var_decl &var)
 Returns an ID for a given variable. More...
 
istr_fn_ptr_set_map_typeid_fns_map ()
 Getter for a map of the IDs of the functions that are present in the set of exported functions. More...
 
const istr_fn_ptr_set_map_typeid_fns_map () const
 Getter for a map of the IDs of the functions that are present in the set of exported functions. More...
 
istr_var_ptr_map_typeid_var_map ()
 Getter for a map of the IDs of the variables that are present in the set of exported variables. More...
 
const istr_var_ptr_map_typeid_var_map () const
 Getter for a map of the IDs of the variables that are present in the set of exported variables. More...
 
bool keep_wrt_id_of_fns_to_keep (const function_decl *fn)
 Look at the set of functions to keep and tell if if a given function is to be kept, according to that set. More...
 
bool keep_wrt_id_of_vars_to_keep (const var_decl *var)
 Look at the regular expressions of the variables to keep and tell if if a given variable is to be kept, according to that set. More...
 
bool keep_wrt_regex_of_fns_to_keep (const function_decl *fn)
 Look at the regular expressions of the functions to keep and tell if if a given function is to be kept, according to that set. More...
 
bool keep_wrt_regex_of_fns_to_suppress (const function_decl *fn)
 Look at the set of functions to suppress from the exported functions set and tell if if a given function is to be kept, according to that set. More...
 
bool keep_wrt_regex_of_vars_to_keep (const var_decl *var)
 Look at the regular expressions of the variables to keep and tell if if a given variable is to be kept, according to that set. More...
 
bool keep_wrt_regex_of_vars_to_suppress (const var_decl *var)
 Look at the set of variables to suppress from the exported variables set and tell if if a given variable is to be kept, according to that set. More...
 
const strings_typesym_id_of_fns_to_keep () const
 Getter for the set of ids of functions to keep in the set of exported functions. More...
 
const strings_typesym_id_of_vars_to_keep () const
 Getter for the set of ids of variables to keep in the set of exported variables. More...
 
bool var_id_is_in_id_var_map (const interned_string &var_id) const
 Test if a given (ID of a) varialble is present in the variable map. In other words, it tests if a given variable is present in the set of exported variables. More...
 

Static Public Member Functions

static bool fn_is_in_fns (function_decl *fn, const std::unordered_set< function_decl * > &fns)
 Test if a given function is present in a set of functions. More...
 
static bool fn_is_in_fns_by_repr (function_decl *fn, const std::unordered_set< function_decl * > &fns, string &pretty_representation)
 Test if a given function is present in a set of functions, by looking at the pretty representation of the function, in addition to looking at its ID. More...
 

Friends

class corpus
 
class corpus::exported_decls_builder
 

Detailed Description

The type of the private data of corpus::exported_decls_builder type.

Definition at line 68 of file abg-corpus-priv.h.

Member Function Documentation

◆ add_fn_to_exported()

void add_fn_to_exported ( function_decl fn)
inline

Add a function to the set of exported functions.

Parameters
fnthe function to add to the set of exported functions.

Definition at line 465 of file abg-corpus-priv.h.

◆ add_fn_to_id_fns_map()

void add_fn_to_id_fns_map ( function_decl fn)
inline

Add a given function to the map of functions that are present in the set of exported functions.

Parameters
fnthe function to add to the map.

Definition at line 399 of file abg-corpus-priv.h.

◆ add_var_to_exported()

void add_var_to_exported ( const var_decl var)
inline

Add a variable to the set of exported variables.

Parameters
fnthe variable to add to the set of exported variables.

Definition at line 478 of file abg-corpus-priv.h.

◆ add_var_to_map()

void add_var_to_map ( var_decl var)
inline

Add a given variable to the map of functions that are present in the set of exported functions.

Parameters
idthe variable to add to the map.

Definition at line 452 of file abg-corpus-priv.h.

◆ compiled_regex_fns_keep()

regex_t_sptrs_type& compiled_regex_fns_keep ( )
inline

Getter for the compiled regular expressions that designates the functions to keep in the set of exported functions.

Returns
a vector of compiled regular expressions.

Definition at line 145 of file abg-corpus-priv.h.

◆ compiled_regex_fns_suppress()

regex_t_sptrs_type& compiled_regex_fns_suppress ( )
inline

Getter for the compiled regular expressions that designate the functions to suppress from the set of exported functions.

Returns
a vector of the compiled regular expressions.

Definition at line 123 of file abg-corpus-priv.h.

◆ compiled_regex_vars_keep()

regex_t_sptrs_type& compiled_regex_vars_keep ( )
inline

Getter for the compiled regular expressions that designate the variables to keep in the set of exported variables.

Returns
a vector of compiled regular expressions.

Definition at line 189 of file abg-corpus-priv.h.

◆ compiled_regex_vars_suppress()

regex_t_sptrs_type& compiled_regex_vars_suppress ( )
inline

Getter of the compiled regular expressions that designate the variables to suppress from the set of exported variables.

Returns
a vector of compiled regular expressions.

Definition at line 167 of file abg-corpus-priv.h.

◆ fn_id_is_in_id_fns_map() [1/2]

std::unordered_set<function_decl*>* fn_id_is_in_id_fns_map ( const function_decl fn)
inline

Test if a a function if the same ID as a given function is present in the id-functions map.

Parameters
fnthe function to consider.
Returns
a pointer to the vector of functions with the same ID as fn, that are present in the id-functions map, or nil if no function with the same ID as fn is present in the id-functions map.

Definition at line 309 of file abg-corpus-priv.h.

◆ fn_id_is_in_id_fns_map() [2/2]

std::unordered_set<function_decl*>* fn_id_is_in_id_fns_map ( const interned_string fn_id)
inline

Test if a given function ID is in the id-functions map.

If it is, then return a pointer to the vector of functions with that ID. If not, just return nil.

Parameters
fn_idthe ID to consider.
Returns
the pointer to the vector of functions with ID fn_id, or nil if no function with that ID exists.

Definition at line 290 of file abg-corpus-priv.h.

◆ fn_is_in_fns()

static bool fn_is_in_fns ( function_decl fn,
const std::unordered_set< function_decl * > &  fns 
)
inlinestatic

Test if a given function is present in a set of functions.

The function compares the ID and the qualified name of functions.

Parameters
fnthe function to consider.

@parm fns the set of functions to consider.

Definition at line 324 of file abg-corpus-priv.h.

◆ fn_is_in_fns_by_repr()

static bool fn_is_in_fns_by_repr ( function_decl fn,
const std::unordered_set< function_decl * > &  fns,
string &  pretty_representation 
)
inlinestatic

Test if a given function is present in a set of functions, by looking at the pretty representation of the function, in addition to looking at its ID.

This is useful because sometimes a given ELF symbol (alias) might be for several different functions. In that case, using the function pretty representation might be a way to differentiate the functions having the same ELF symbol alias.

The function compares the ID and the qualified name of functions.

Parameters
fnthe function to consider.

@parm fns the set of functions to consider.

Returns
true if fn is present in fns.

Definition at line 360 of file abg-corpus-priv.h.

◆ fn_is_in_id_fns_map()

bool fn_is_in_id_fns_map ( function_decl fn)
inline

Test if a function is in the id-functions map.

Parameters
fnthe function to consider.
Returns
true iff the function is in the id-functions map.

Definition at line 386 of file abg-corpus-priv.h.

◆ get_id() [1/2]

interned_string get_id ( const function_decl fn)
inline

Returns an ID for a given function.

Parameters
fnthe function to calculate the ID for.
Returns
a reference to a string representing the function ID.

Definition at line 268 of file abg-corpus-priv.h.

◆ get_id() [2/2]

interned_string get_id ( const var_decl var)
inline

Returns an ID for a given variable.

Parameters
varthe variable to calculate the ID for.
Returns
a reference to a string representing the variable ID.

Definition at line 277 of file abg-corpus-priv.h.

◆ id_fns_map() [1/2]

istr_fn_ptr_set_map_type& id_fns_map ( )
inline

Getter for a map of the IDs of the functions that are present in the set of exported functions.

This map is useful during the construction of the set of exported functions, at least to ensure that every function is present only once in that set.

Returns
a map which key is a string and which data is a pointer to a function.

Definition at line 233 of file abg-corpus-priv.h.

◆ id_fns_map() [2/2]

const istr_fn_ptr_set_map_type& id_fns_map ( ) const
inline

Getter for a map of the IDs of the functions that are present in the set of exported functions.

This map is useful during the construction of the set of exported functions, at least to ensure that every function is present only once in that set. Actually, for each symbol ID, there can be several functions, given that each of those have different declaration names; this can happen with function template instantiations which decl names differ because the type parameters of the templates are typedefs of each other.

Returns
a map which key is a string and which data is a pointer to a function.

Definition at line 220 of file abg-corpus-priv.h.

◆ id_var_map() [1/2]

istr_var_ptr_map_type& id_var_map ( )
inline

Getter for a map of the IDs of the variables that are present in the set of exported variables.

This map is useful during the construction of the set of exported variables, at least to ensure that every function is present only once in that set.

Returns
a map which key is a string and which data is a pointer to a function.

Definition at line 259 of file abg-corpus-priv.h.

◆ id_var_map() [2/2]

const istr_var_ptr_map_type& id_var_map ( ) const
inline

Getter for a map of the IDs of the variables that are present in the set of exported variables.

This map is useful during the construction of the set of exported variables, at least to ensure that every function is present only once in that set.

Returns
a map which key is a string and which data is a pointer to a function.

Definition at line 246 of file abg-corpus-priv.h.

◆ keep_wrt_id_of_fns_to_keep()

bool keep_wrt_id_of_fns_to_keep ( const function_decl fn)
inline

Look at the set of functions to keep and tell if if a given function is to be kept, according to that set.

Parameters
fnthe function to consider.
Returns
true iff the function is to be kept.

Definition at line 513 of file abg-corpus-priv.h.

◆ keep_wrt_id_of_vars_to_keep()

bool keep_wrt_id_of_vars_to_keep ( const var_decl var)
inline

Look at the regular expressions of the variables to keep and tell if if a given variable is to be kept, according to that set.

Parameters
fnthe variable to consider.
Returns
true iff the variable is to be kept.

Definition at line 620 of file abg-corpus-priv.h.

◆ keep_wrt_regex_of_fns_to_keep()

bool keep_wrt_regex_of_fns_to_keep ( const function_decl fn)
inline

Look at the regular expressions of the functions to keep and tell if if a given function is to be kept, according to that set.

Parameters
fnthe function to consider.
Returns
true iff the function is to be kept.

Definition at line 587 of file abg-corpus-priv.h.

◆ keep_wrt_regex_of_fns_to_suppress()

bool keep_wrt_regex_of_fns_to_suppress ( const function_decl fn)
inline

Look at the set of functions to suppress from the exported functions set and tell if if a given function is to be kept, according to that set.

Parameters
fnthe function to consider.
Returns
true iff the function is to be kept.

Definition at line 558 of file abg-corpus-priv.h.

◆ keep_wrt_regex_of_vars_to_keep()

bool keep_wrt_regex_of_vars_to_keep ( const var_decl var)
inline

Look at the regular expressions of the variables to keep and tell if if a given variable is to be kept, according to that set.

Parameters
fnthe variable to consider.
Returns
true iff the variable is to be kept.

Definition at line 694 of file abg-corpus-priv.h.

◆ keep_wrt_regex_of_vars_to_suppress()

bool keep_wrt_regex_of_vars_to_suppress ( const var_decl var)
inline

Look at the set of variables to suppress from the exported variables set and tell if if a given variable is to be kept, according to that set.

Parameters
fnthe variable to consider.
Returns
true iff the variable is to be kept.

Definition at line 665 of file abg-corpus-priv.h.

◆ sym_id_of_fns_to_keep()

const strings_type& sym_id_of_fns_to_keep ( ) const
inline

Getter for the set of ids of functions to keep in the set of exported functions.

Returns
the set of ids of functions to keep in the set of exported functions.

Definition at line 494 of file abg-corpus-priv.h.

◆ sym_id_of_vars_to_keep()

const strings_type& sym_id_of_vars_to_keep ( ) const
inline

Getter for the set of ids of variables to keep in the set of exported variables.

Returns
the set of ids of variables to keep in the set of exported variables.

Definition at line 503 of file abg-corpus-priv.h.

◆ var_id_is_in_id_var_map()

bool var_id_is_in_id_var_map ( const interned_string var_id) const
inline

Test if a given (ID of a) varialble is present in the variable map. In other words, it tests if a given variable is present in the set of exported variables.

Parameters
fn_idthe ID of the variable to consider.
Returns
true iff the variable designated by fn_id is present in the set of exported variables.

Definition at line 440 of file abg-corpus-priv.h.


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