cprover
remove_virtual_functionst Class Reference
Collaboration diagram for remove_virtual_functionst:
[legend]

Public Member Functions

 remove_virtual_functionst (const symbol_table_baset &_symbol_table, const class_hierarchyt &_class_hierarchy)
 
void operator() (goto_functionst &goto_functions)
 
bool remove_virtual_functions (goto_programt &goto_program)
 
goto_programt::targett remove_virtual_function (goto_programt &goto_program, goto_programt::targett target, const dispatch_table_entriest &functions, virtual_dispatch_fallback_actiont fallback_action)
 
void get_functions (const exprt &, dispatch_table_entriest &)
 Used to get dispatch entries to call for the given function. More...
 

Protected Types

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

Protected Member Functions

goto_programt::targett remove_virtual_function (goto_programt &goto_program, goto_programt::targett target)
 
void get_child_functions_rec (const irep_idt &, const symbol_exprt &, const irep_idt &, dispatch_table_entriest &, dispatch_table_entries_mapt &, const function_call_resolvert &) 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
 

Protected Attributes

const namespacet ns
 
const symbol_table_basetsymbol_table
 
const class_hierarchytclass_hierarchy
 

Detailed Description

Definition at line 22 of file remove_virtual_functions.cpp.

Member Typedef Documentation

◆ function_call_resolvert

Constructor & Destructor Documentation

◆ remove_virtual_functionst()

remove_virtual_functionst::remove_virtual_functionst ( const symbol_table_baset _symbol_table,
const class_hierarchyt _class_hierarchy 
)

Definition at line 66 of file remove_virtual_functions.cpp.

Member Function Documentation

◆ get_child_functions_rec()

void remove_virtual_functionst::get_child_functions_rec ( const irep_idt this_id,
const symbol_exprt last_method_defn,
const irep_idt component_name,
dispatch_table_entriest functions,
dispatch_table_entries_mapt entry_map,
const function_call_resolvert resolve_function_call 
) const
protected

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

Parameters
parametersthis_id: class name
<tt>last_method_defn</tt>the most-derived parent of this_id to define the requested function
<tt>component_name</tt>name of the function searched for
<tt>entry_map</tt>map of class identifiers to dispatch table entries
<tt>resolve_function_call</tt>function to resolve abstract method call
Returns
functions 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}]

Definition at line 315 of file remove_virtual_functions.cpp.

References class_hierarchy, class_hierarchyt::class_map, resolve_inherited_componentt::inherited_componentt::get_class_identifier(), resolve_inherited_componentt::inherited_componentt::get_full_component_identifier(), get_method(), has_prefix(), id2string(), irept::is_not_nil(), resolve_inherited_componentt::inherited_componentt::is_valid(), symbol_table_baset::lookup_ref(), irept::set(), dispatch_table_entryt::symbol_expr, symbolt::symbol_expr(), symbol_table, and to_symbol_expr().

Referenced by get_functions().

◆ get_functions()

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

◆ get_method()

exprt remove_virtual_functionst::get_method ( const irep_idt class_id,
const irep_idt component_name 
) const
protected

◆ operator()()

void remove_virtual_functionst::operator() ( goto_functionst goto_functions)

◆ remove_virtual_function() [1/2]

◆ remove_virtual_function() [2/2]

◆ remove_virtual_functions()

bool remove_virtual_functionst::remove_virtual_functions ( goto_programt goto_program)

Member Data Documentation

◆ class_hierarchy

const class_hierarchyt& remove_virtual_functionst::class_hierarchy
protected

Definition at line 45 of file remove_virtual_functions.cpp.

Referenced by get_child_functions_rec(), and get_functions().

◆ ns

const namespacet remove_virtual_functionst::ns
protected

Definition at line 42 of file remove_virtual_functions.cpp.

Referenced by get_method(), and remove_virtual_function().

◆ symbol_table

const symbol_table_baset& remove_virtual_functionst::symbol_table
protected

Definition at line 43 of file remove_virtual_functions.cpp.

Referenced by get_child_functions_rec(), and get_functions().


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