17 std::size_t function_pointer_call_counter = 0;
22 return it->is_function_call() && can_cast_expr<dereference_exprt>(
23 it->get_function_call().function());
26 auto const &function_call = it->get_function_call();
27 auto const &function_pointer_dereference =
28 to_dereference_expr(function_call.function());
29 auto const &source_location = function_call.source_location();
30 auto const &goto_function_symbol_mode =
31 goto_model.symbol_table.lookup_ref(goto_function.first).mode;
33 auto const call_site_symbol_name =
34 irep_idt{id2string(goto_function.first) +
".function_pointer_call." +
35 std::to_string(++function_pointer_call_counter)};
39 symbolt function_call_site_symbol{};
40 function_call_site_symbol.name = function_call_site_symbol.base_name =
41 function_call_site_symbol.pretty_name = call_site_symbol_name;
42 function_call_site_symbol.type =
43 function_pointer_dereference.pointer().type();
44 function_call_site_symbol.location = function_call.source_location();
45 function_call_site_symbol.is_lvalue =
true;
46 function_call_site_symbol.mode = goto_function_symbol_mode;
47 return function_call_site_symbol;
50 auto const new_function_pointer =
58 function_pointer_dereference.pointer()},
61 goto_function.second.body.insert_before_swap(it, assign_instruction);
62 const auto next = std::next(it);