◆ function_call_resolvert
◆ remove_virtual_functionst()
◆ get_child_functions_rec()
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 |
[out] | functions | 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}] |
| entry_map | map of class identifiers to dispatch table entries |
| resolve_function_call` | function to resolve abstract method call |
Definition at line 338 of file remove_virtual_functions.cpp.
◆ get_functions()
Used to get dispatch entries to call for the given function.
- Parameters
-
| function | function that should be called |
[out] | functions | is assigned a list of dispatch entries, i.e., pairs of class names and function symbol to call when encountering the class. |
Definition at line 407 of file remove_virtual_functions.cpp.
◆ get_method()
exprt remove_virtual_functionst::get_method |
( |
const irep_idt & |
class_id, |
|
|
const irep_idt & |
component_name |
|
) |
| const |
|
protected |
Returns symbol pointing to a specified method in a specified class.
- Parameters
-
class_id | Class identifier to look up |
component_name | Name 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 495 of file remove_virtual_functions.cpp.
◆ operator()()
void remove_virtual_functionst::operator() |
( |
goto_functionst & |
goto_functions | ) |
|
Remove virtual function calls from all functions in the specified list and replace them with their most derived implementations.
Definition at line 547 of file remove_virtual_functions.cpp.
◆ remove_virtual_function() [1/2]
Replace specified virtual function call with a static call to its most derived implementation.
- Parameters
-
goto_program | [in/out]: GOTO program to modify |
target | iterator: to a function in the supplied GOTO program to replace. Must point to a virtual function call. |
- Returns
- Returns a pointer to the statement in the supplied GOTO program after replaced function call
Definition at line 82 of file remove_virtual_functions.cpp.
◆ remove_virtual_function() [2/2]
Replace virtual function call with a static function call Achieved by substituting a virtual function with its most derived implementation.
If there's a type mismatch between implementation and the instance type or if fallback_action is set to ASSUME_FALSE, then function is substituted with a call to ASSUME(false)
- Parameters
-
goto_program | [in/out]: GOTO program to modify |
target | Iterator to the GOTO instruction in the supplied GOTO program to be removed. Must point to a function call |
functions | Dispatch table - all possible implementations of this function sorted from the least to the most derived |
fallback_action | - ASSUME_FALSE to replace virtual function calls with ASSUME(false) or CALL_LAST_FUNCTION to replace them with the most derived matching call |
- Returns
- Returns a pointer to the statement in the supplied GOTO program after replaced function call
Definition at line 144 of file remove_virtual_functions.cpp.
◆ remove_virtual_functions()
bool remove_virtual_functionst::remove_virtual_functions |
( |
goto_programt & |
goto_program | ) |
|
Remove all virtual function calls in a GOTO program and replace them with calls to their most derived implementations.
Returns true if at least one function has been replaced.
Definition at line 513 of file remove_virtual_functions.cpp.
◆ class_hierarchy
◆ ns
◆ symbol_table
The documentation for this class was generated from the following file: