14 #include <unordered_set>
30 for(
auto &identifier :
function.parameter_identifiers)
32 auto entry = rename_symbol.
expr_map.find(identifier);
33 if(entry != rename_symbol.
expr_map.end())
34 identifier = entry->second;
37 for(
auto &instruction :
function.body.instructions)
39 rename_symbol(instruction.code);
41 if(instruction.has_condition())
43 exprt c = instruction.get_condition();
45 instruction.set_condition(c);
58 const std::unordered_set<irep_idt> &weak_symbols,
68 rename_symbolt::expr_mapt::const_iterator e_it =
69 rename_symbol.
expr_map.find(gf_entry.first);
73 if(e_it!=rename_symbol.
expr_map.end())
74 final_id=e_it->second;
77 goto_functionst::function_mapt::iterator dest_f_it=
84 dest_functions.
function_map.emplace(final_id, std::move(src_func));
90 if(in_dest_symbol_table.body.instructions.empty() ||
91 weak_symbols.find(final_id)!=weak_symbols.end())
96 in_dest_symbol_table.body.swap(src_func.body);
97 in_dest_symbol_table.parameter_identifiers.swap(
98 src_func.parameter_identifiers);
101 src_func.body.instructions.empty() ||
102 src_ns.
lookup(gf_entry.first).is_weak)
116 for(
const auto &symbol_pair : dest_symbol_table.
symbols)
118 if(symbol_pair.second.is_macro && !symbol_pair.second.is_type)
120 const symbolt &symbol = symbol_pair.second;
128 std::cerr << symbol <<
'\n';
129 std::cerr << ns.
lookup(
id) <<
'\n';
139 if(!macro_application.
expr_map.empty())
148 if(!object_type_updates.
empty())
152 for(
auto &instruction : gf_entry.second.body.instructions)
154 instruction.transform([&object_type_updates](
exprt expr) {
155 object_type_updates(expr);
170 std::unordered_set<irep_idt> weak_symbols;
174 if(symbol_pair.second.is_weak)
175 weak_symbols.insert(symbol_pair.first);