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