29 std::set<irep_idt> used_functions;
30 std::list<goto_functionst::function_mapt::iterator> unused_functions;
34 for(goto_functionst::function_mapt::iterator it=
39 if(used_functions.find(it->first)==used_functions.end())
40 unused_functions.push_back(it);
45 if(!unused_functions.empty())
48 <<
"Dropping " << unused_functions.size() <<
" of " <<
53 for(
const auto &f : unused_functions)
60 std::set<irep_idt> &seen)
62 std::pair<std::set<irep_idt>::const_iterator,
bool> res =
69 goto_functionst::function_mapt::const_iterator f_it =
void remove_unused_functions(goto_modelt &goto_model, message_handlert &message_handler)
function_mapt function_map
codet representation of a function call statement.
A collection of goto functions.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
Class that provides messages with a built-in verbosity 'level'.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
void find_used_functions(const irep_idt &start, goto_functionst &functions, std::set< irep_idt > &seen)
#define forall_goto_program_instructions(it, program)
goto_functionst goto_functions
GOTO functions.
mstreamt & statistics() const
const code_function_callt & to_code_function_call(const codet &code)