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

Classes

class  functiont
 

Public Member Functions

 remove_virtual_functionst (const symbol_tablet &_symbol_table, const goto_functionst &goto_functions)
 
void operator() (goto_functionst &goto_functions)
 
bool remove_virtual_functions (goto_programt &goto_program)
 

Protected Types

typedef std::vector< functiontfunctionst
 

Protected Member Functions

void remove_virtual_function (goto_programt &goto_program, goto_programt::targett target)
 
void get_functions (const exprt &, functionst &)
 
void get_child_functions_rec (const irep_idt &, const symbol_exprt &, const irep_idt &, functionst &, std::set< irep_idt > &visited) 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_tabletsymbol_table
 
class_hierarchyt class_hierarchy
 

Detailed Description

Definition at line 20 of file remove_virtual_functions.cpp.

Member Typedef Documentation

◆ functionst

typedef std::vector<functiont> remove_virtual_functionst::functionst
protected

Definition at line 53 of file remove_virtual_functions.cpp.

Constructor & Destructor Documentation

◆ remove_virtual_functionst()

remove_virtual_functionst::remove_virtual_functionst ( const symbol_tablet _symbol_table,
const goto_functionst goto_functions 
)

Definition at line 66 of file remove_virtual_functions.cpp.

References class_hierarchy, and symbol_table.

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,
functionst functions,
std::set< irep_idt > &  visited 
) const
protected

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

parameters: this_id: class name
last_method_defn: the most-derived parent of this_id to define the requested function component_name: name of the function searched for
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 218 of file remove_virtual_functions.cpp.

References class_hierarchy, class_hierarchyt::class_map, get_method(), irept::is_not_nil(), remove_virtual_functionst::functiont::symbol_expr, and to_symbol_expr().

Referenced by get_functions().

◆ get_functions()

void remove_virtual_functionst::get_functions ( const exprt function,
functionst functions 
)
protected

◆ get_method()

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

◆ operator()()

◆ remove_virtual_function()

◆ remove_virtual_functions()

bool remove_virtual_functionst::remove_virtual_functions ( goto_programt goto_program)

Member Data Documentation

◆ class_hierarchy

class_hierarchyt remove_virtual_functionst::class_hierarchy
protected

◆ ns

const namespacet remove_virtual_functionst::ns
protected

Definition at line 32 of file remove_virtual_functions.cpp.

Referenced by get_method(), and remove_virtual_function().

◆ symbol_table

const symbol_tablet& remove_virtual_functionst::symbol_table
protected

Definition at line 33 of file remove_virtual_functions.cpp.

Referenced by remove_virtual_functionst().


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