libabigail
Loading...
Searching...
No Matches
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.
 
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.
 
void add_var_to_exported (const var_decl_sptr &var)
 Add a variable to the set of exported variables.
 
void add_var_to_id_vars_map (const var_decl_sptr &var)
 Add a given variable to the map of variables that are present in the set of exported variables.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
bool fn_is_in_id_fns_map (function_decl *fn)
 Test if a function is in the id-functions map.
 
interned_string get_id (const function_decl &fn)
 Returns an ID for a given function.
 
interned_string get_id (const var_decl &var)
 Returns an ID for a given variable.
 
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.
 
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.
 
istr_var_ptr_set_map_typeid_vars_map ()
 Getter for a map of the IDs of the variables that are present in the set of exported variables.
 
const istr_var_ptr_set_map_typeid_vars_map () const
 Getter for a map of the IDs of the variables that are present in the set of exported variables.
 
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.
 
bool keep_wrt_id_of_vars_to_keep (const var_decl_sptr &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.
 
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.
 
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.
 
bool keep_wrt_regex_of_vars_to_keep (const var_decl_sptr &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.
 
bool keep_wrt_regex_of_vars_to_suppress (const var_decl_sptr 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.
 
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.
 
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.
 
std::unordered_set< var_decl_sptr > * var_id_is_in_id_vars_map (const interned_string &var_id)
 Test if a given (ID of a) variable is present in the variable map. In other words, it tests if a given variable is present in the set of exported variables.
 
const std::unordered_set< var_decl_sptr > * var_id_is_in_id_vars_map (const interned_string &var_id) const
 Test if a given (ID of a) variable is present in the variable map. In other words, it tests if a given variable is present in the set of exported variables.
 
bool var_is_in_id_vars_map (const var_decl_sptr &var)
 Test if a given variable is present in a set of variables.
 

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.
 
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.
 
static bool var_is_in_vars (const var_decl_sptr &var, const std::unordered_set< var_decl_sptr > &vars)
 Test if a given variable is present in a set of variables.
 

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 74 of file abg-corpus-priv.h.

Constructor & Destructor Documentation

◆ priv()

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 )
inline

Definition at line 106 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 557 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 402 of file abg-corpus-priv.h.

◆ add_var_to_exported()

void add_var_to_exported ( const var_decl_sptr & 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 570 of file abg-corpus-priv.h.

◆ add_var_to_id_vars_map()

void add_var_to_id_vars_map ( const var_decl_sptr & var)
inline

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

Parameters
fnthe variable to add to the map.

Definition at line 521 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 151 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 129 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 195 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 173 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 312 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 293 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 327 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 363 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 389 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 271 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 280 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.

The map associates the ID of a function with the set of functions having the symbol that matches the ID.

Returns
a map which key is a string and which data is a set of functions.

Definition at line 238 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 226 of file abg-corpus-priv.h.

◆ id_vars_map() [1/2]

istr_var_ptr_set_map_type & id_vars_map ( )
inline

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

The map associates the ID of a variable with the set of variables having the symbol that matches the ID.

Returns
a map which key is a string and which data is a set of variables.

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

◆ id_vars_map() [2/2]

const istr_var_ptr_set_map_type & id_vars_map ( ) const
inline

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

The map associates the ID of a variable with the set of variables having the symbol that matches the ID.

Returns
a map which key is a string and which data is a set of variables.

Definition at line 262 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 604 of file abg-corpus-priv.h.

◆ keep_wrt_id_of_vars_to_keep()

bool keep_wrt_id_of_vars_to_keep ( const var_decl_sptr & 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 711 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 678 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 649 of file abg-corpus-priv.h.

◆ keep_wrt_regex_of_vars_to_keep()

bool keep_wrt_regex_of_vars_to_keep ( const var_decl_sptr & 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 785 of file abg-corpus-priv.h.

◆ keep_wrt_regex_of_vars_to_suppress()

bool keep_wrt_regex_of_vars_to_suppress ( const var_decl_sptr 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 756 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 585 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 594 of file abg-corpus-priv.h.

◆ var_id_is_in_id_vars_map() [1/2]

std::unordered_set< var_decl_sptr > * var_id_is_in_id_vars_map ( const interned_string & var_id)
inline

Test if a given (ID of a) variable 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
a pointer to the set of variables that have the same ID as var_id.

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

◆ var_id_is_in_id_vars_map() [2/2]

const std::unordered_set< var_decl_sptr > * var_id_is_in_id_vars_map ( const interned_string & var_id) const
inline

Test if a given (ID of a) variable 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
a pointer to the set of variables that have the same ID as var_id.

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

◆ var_is_in_id_vars_map()

bool var_is_in_id_vars_map ( const var_decl_sptr & var)
inline

Test if a given variable is present in a set of variables.

The variable compares the ID and the qualified name of variables.

Parameters
fnthe variable to consider.

@parm fns the set of variables to consider.

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

◆ var_is_in_vars()

static bool var_is_in_vars ( const var_decl_sptr & var,
const std::unordered_set< var_decl_sptr > & vars )
inlinestatic

Test if a given variable is present in a set of variables.

The variable compares the ID and the qualified name of variables.

Parameters
fnthe variable to consider.

@parm fns the set of variables to consider.

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

Friends And Related Symbol Documentation

◆ corpus

friend class corpus
friend

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

◆ corpus::exported_decls_builder

friend class corpus::exported_decls_builder
friend

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


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