36 for(
auto target = f.second.body.instructions.begin();
37 target != f.second.body.instructions.end();
40 if(target->is_function_call())
42 const auto &
function =
as_const(*target).call_function();
43 if(
function.
id() == ID_dereference)
49 auto addresses = value_sets.
get_values(f.first, target, pointer);
51 std::unordered_set<symbol_exprt, irep_hash> functions;
53 for(
const auto &address : addresses)
57 if(address.id() == ID_object_descriptor)
60 const auto &
object = od.object();
61 if(
object.type().
id() == ID_code &&
object.
id() == ID_symbol)
66 for(
const auto &f : functions)
70 if(functions.size() > 0)
const T & as_const(T &value)
Return a reference to the same object but ensures the type is const.
function_mapt function_map
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
source_locationt source_location
Class that provides messages with a built-in verbosity 'level'.
mstreamt & status() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
std::vector< exprt > get_values(const irep_idt &function_id, locationt l, const exprt &expr) override
API to expression classes for Pointers.
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
const object_descriptor_exprt & to_object_descriptor_expr(const exprt &expr)
Cast an exprt to an object_descriptor_exprt.
void remove_function_pointer(message_handlert &message_handler, symbol_tablet &symbol_table, goto_programt &goto_program, const irep_idt &function_id, goto_programt::targett target, const std::unordered_set< symbol_exprt, irep_hash > &functions)
Replace a call to a dynamic function at location target in the given goto-program by a case-split ove...
Remove Indirect Function Calls.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
Value Set Propagation (flow insensitive)
void value_set_fi_fp_removal(goto_modelt &goto_model, message_handlert &message_handler)
Builds the flow-insensitive value set for all function pointers and replaces function pointers with a...
flow insensitive value set function pointer removal