CBMC
get_virtual_calleest Class Reference
+ Collaboration diagram for get_virtual_calleest:

Public Member Functions

 get_virtual_calleest (const symbol_table_baset &_symbol_table, const class_hierarchyt &_class_hierarchy)
 
void get_functions (const exprt &, dispatch_table_entriest &) const
 Used to get dispatch entries to call for the given function. More...
 

Private Types

typedef std::function< std::optional< resolve_inherited_componentt::inherited_componentt > const irep_idt &, const irep_idt &)> function_call_resolvert
 

Private Member Functions

void get_child_functions_rec (const irep_idt &, const std::optional< symbol_exprt > &, const irep_idt &, dispatch_table_entriest &, dispatch_table_entries_mapt &) const
 Used by get_functions to track the most-derived parent that provides an override of a given function. More...
 
exprt get_method (const irep_idt &class_id, const irep_idt &component_name) const
 Returns symbol pointing to a specified method in a specified class. More...
 

Private Attributes

const namespacet ns
 
const symbol_table_basetsymbol_table
 
const class_hierarchytclass_hierarchy
 

Detailed Description

Definition at line 26 of file remove_virtual_functions.cpp.

Member Typedef Documentation

◆ function_call_resolvert

Definition at line 50 of file remove_virtual_functions.cpp.

Constructor & Destructor Documentation

◆ get_virtual_calleest()

get_virtual_calleest::get_virtual_calleest ( const symbol_table_baset _symbol_table,
const class_hierarchyt _class_hierarchy 
)
inline

Definition at line 29 of file remove_virtual_functions.cpp.

Member Function Documentation

◆ get_child_functions_rec()

void get_virtual_calleest::get_child_functions_rec ( const irep_idt this_id,
const std::optional< symbol_exprt > &  last_method_defn,
const irep_idt component_name,
dispatch_table_entriest functions,
dispatch_table_entries_mapt entry_map 
) const
private

Used by get_functions to track the most-derived parent that provides an override of a given function.

Parameters
this_idclass name
last_method_defnthe most-derived parent of this_id to define the requested function
component_namename of the function searched for
[out]functionsfunctions is assigned a list of {class name, function symbol} pairs indicating that if this is of the given class, then the call will target the given function. Thus if A <: B <: C and A and C provide overrides of f (but B does not), get_child_functions_rec("C", C.f, "f") -> [{"C", C.f}, {"B", C.f}, {"A", A.f}]
entry_mapmap of class identifiers to dispatch table entries

Definition at line 507 of file remove_virtual_functions.cpp.

◆ get_functions()

void get_virtual_calleest::get_functions ( const exprt function,
dispatch_table_entriest functions 
) const

Used to get dispatch entries to call for the given function.

Parameters
functionfunction that should be called
[out]functionsis assigned a list of dispatch entries, i.e., pairs of class names and function symbol to call when encountering the class.

Definition at line 569 of file remove_virtual_functions.cpp.

◆ get_method()

exprt get_virtual_calleest::get_method ( const irep_idt class_id,
const irep_idt component_name 
) const
private

Returns symbol pointing to a specified method in a specified class.

Parameters
class_idClass identifier to look up
component_nameName of the function to look up
Returns
nil_exprt instance on error and a symbol_exprt pointing to the method on success

Definition at line 641 of file remove_virtual_functions.cpp.

Member Data Documentation

◆ class_hierarchy

const class_hierarchyt& get_virtual_calleest::class_hierarchy
private

Definition at line 44 of file remove_virtual_functions.cpp.

◆ ns

const namespacet get_virtual_calleest::ns
private

Definition at line 41 of file remove_virtual_functions.cpp.

◆ symbol_table

const symbol_table_baset& get_virtual_calleest::symbol_table
private

Definition at line 42 of file remove_virtual_functions.cpp.


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