14 #include <unordered_set>
29 for(
auto &identifier :
function.parameter_identifiers)
31 auto entry = rename_symbol.
expr_map.find(identifier);
32 if(entry != rename_symbol.
expr_map.end())
33 identifier = entry->second;
36 for(
auto &instruction :
function.body.instructions)
38 rename_symbol(instruction.code_nonconst());
40 if(instruction.has_condition())
42 exprt c = instruction.get_condition();
44 instruction.set_condition(c);
57 const std::unordered_set<irep_idt> &weak_symbols,
67 rename_symbolt::expr_mapt::const_iterator e_it =
68 rename_symbol.
expr_map.find(gf_entry.first);
72 if(e_it!=rename_symbol.
expr_map.end())
73 final_id=e_it->second;
76 goto_functionst::function_mapt::iterator dest_f_it=
83 dest_functions.
function_map.emplace(final_id, std::move(src_func));
89 if(in_dest_symbol_table.body.instructions.empty() ||
90 weak_symbols.find(final_id)!=weak_symbols.end())
95 in_dest_symbol_table.body.swap(src_func.body);
96 in_dest_symbol_table.parameter_identifiers.swap(
97 src_func.parameter_identifiers);
100 src_func.body.instructions.empty() ||
101 src_ns.
lookup(gf_entry.first).is_weak)
115 for(
const auto &symbol_pair : dest_symbol_table.
symbols)
117 if(symbol_pair.second.is_macro && !symbol_pair.second.is_type)
119 const symbolt &symbol = symbol_pair.second;
127 std::cerr << symbol <<
'\n';
128 std::cerr << ns.
lookup(
id) <<
'\n';
138 if(!macro_application.
expr_map.empty())
147 if(!object_type_updates.
empty())
151 for(
auto &instruction : gf_entry.second.body.instructions)
153 instruction.transform([&object_type_updates](
exprt expr) {
154 object_type_updates(expr);
169 std::unordered_set<irep_idt> weak_symbols;
173 if(symbol_pair.second.is_weak)
174 weak_symbols.insert(symbol_pair.first);