cprover
remove_virtual_functions.cpp File Reference

Remove Virtual Function (Method) Calls. More...

#include "remove_virtual_functions.h"
#include <algorithm>
#include <util/type_eq.h>
#include "class_identifier.h"
#include "goto_model.h"
#include "remove_skip.h"
#include "resolve_inherited_component.h"
Include dependency graph for remove_virtual_functions.cpp:

Go to the source code of this file.

Classes

class  remove_virtual_functionst
 

Functions

static void create_static_function_call (code_function_callt &call, const symbol_exprt &function_symbol, const namespacet &ns)
 Create a concrete function call to replace a virtual one. More...
 
void remove_virtual_functions (const symbol_table_baset &symbol_table, goto_functionst &goto_functions)
 
void remove_virtual_functions (goto_modelt &goto_model)
 
void remove_virtual_functions (goto_model_functiont &function)
 Remove virtual functions from one function. More...
 
goto_programt::targett remove_virtual_function (symbol_tablet &symbol_table, goto_programt &goto_program, goto_programt::targett instruction, const dispatch_table_entriest &dispatch_table, virtual_dispatch_fallback_actiont fallback_action)
 
goto_programt::targett remove_virtual_function (goto_modelt &goto_model, goto_programt &goto_program, goto_programt::targett instruction, const dispatch_table_entriest &dispatch_table, virtual_dispatch_fallback_actiont fallback_action)
 
void collect_virtual_function_callees (const exprt &function, const symbol_table_baset &symbol_table, const class_hierarchyt &class_hierarchy, dispatch_table_entriest &overridden_functions)
 

Detailed Description

Remove Virtual Function (Method) Calls.

Definition in file remove_virtual_functions.cpp.

Function Documentation

◆ collect_virtual_function_callees()

void collect_virtual_function_callees ( const exprt function,
const symbol_table_baset symbol_table,
const class_hierarchyt class_hierarchy,
dispatch_table_entriest overridden_functions 
)

◆ create_static_function_call()

static void create_static_function_call ( code_function_callt call,
const symbol_exprt function_symbol,
const namespacet ns 
)
static

Create a concrete function call to replace a virtual one.

Parameters
call[in/out]: the function call to update
function_symbolthe function to be called
nsnamespace

Definition at line 104 of file remove_virtual_functions.cpp.

References code_function_callt::arguments(), code_function_callt::function(), symbol_exprt::get_identifier(), code_typet::parametert::get_this(), INVARIANT, namespacet::lookup(), to_code_type(), exprt::type(), and type_eq().

Referenced by remove_virtual_functionst::remove_virtual_function().

◆ remove_virtual_function() [1/2]

goto_programt::targett remove_virtual_function ( symbol_tablet symbol_table,
goto_programt goto_program,
goto_programt::targett  instruction,
const dispatch_table_entriest dispatch_table,
virtual_dispatch_fallback_actiont  fallback_action 
)

◆ remove_virtual_function() [2/2]

goto_programt::targett remove_virtual_function ( goto_modelt goto_model,
goto_programt goto_program,
goto_programt::targett  instruction,
const dispatch_table_entriest dispatch_table,
virtual_dispatch_fallback_actiont  fallback_action 
)

◆ remove_virtual_functions() [1/3]

◆ remove_virtual_functions() [2/3]

void remove_virtual_functions ( goto_modelt goto_model)

◆ remove_virtual_functions() [3/3]

void remove_virtual_functions ( goto_model_functiont function)

Remove virtual functions from one function.

May change the location numbers in function.

Parameters
functionfunction from which virtual functions should be converted to explicit dispatch tables.

Definition at line 549 of file remove_virtual_functions.cpp.

References remove_virtual_functionst::remove_virtual_functions().