35 goto_functionst::function_mapt::iterator entry=
40 message.
error() <<
"No function " << identifier
47 message.
warning() <<
"Function " << identifier <<
" is inlined, "
48 <<
"instantiations will not be removed"
52 if(entry->second.body_available())
54 message.
status() <<
"Removing body of " << identifier
56 entry->second.clear();
72 const std::list<std::string> &names,
75 for(
const auto &f : names)
86 const std::regex &pattern,
87 const std::string &pattern_as_str,
92 message.
debug() <<
"Removing functions matching pattern: " << pattern_as_str
97 std::list<irep_idt> matching_functions;
101 const std::string &function_name =
id2string(entry.first);
102 if(std::regex_match(function_name, pattern))
104 matching_functions.push_back(entry.first);
109 for(
const auto &func : matching_functions)
114 message.
debug() <<
"Removed " << matching_functions.size()
115 <<
" function(s) matching pattern: " << pattern_as_str
121 const std::string &pattern,
128 std::regex regex_pattern{pattern};
132 catch(
const std::regex_error &e)
134 message.
error() <<
"Invalid regular expression pattern: " << pattern <<
" ("
function_mapt function_map
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
Class that provides messages with a built-in verbosity 'level'.
mstreamt & warning() const
mstreamt & status() const
symbolt & get_writeable_ref(const irep_idt &name)
Find a symbol in the symbol table for read-write access.
const symbolt & lookup_ref(const irep_idt &name) const
Find a symbol in the symbol table for read-only access.
typet type
Type of symbol.
exprt value
Initial value of symbol.
const std::string & id2string(const irep_idt &d)
void remove_function(goto_modelt &goto_model, const irep_idt &identifier, message_handlert &message_handler)
Remove the body of function "identifier" such that an analysis will treat it as a side-effect free fu...
void remove_functions(goto_modelt &goto_model, const std::list< std::string > &names, message_handlert &message_handler)
Remove the body of all functions listed in "names" such that an analysis will treat it as a side-effe...
static void remove_functions_regex(goto_modelt &goto_model, const std::regex &pattern, const std::string &pattern_as_str, message_handlert &message_handler)
Remove functions matching a regular expression pattern.
Remove function definition.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.