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;
38 rename_symbol(
function.type);
42 rename_symbol(iit->code);
44 if(iit->has_condition())
46 exprt c = iit->get_condition();
48 iit->set_condition(c);
61 const std::unordered_set<irep_idt> &weak_symbols,
71 rename_symbolt::expr_mapt::const_iterator e_it=
72 rename_symbol.
expr_map.find(src_it->first);
76 if(e_it!=rename_symbol.
expr_map.end())
77 final_id=e_it->second;
80 goto_functionst::function_mapt::iterator dest_f_it=
87 dest_functions.
function_map.emplace(final_id, std::move(src_func));
93 if(in_dest_symbol_table.body.instructions.empty() ||
94 weak_symbols.find(final_id)!=weak_symbols.end())
99 in_dest_symbol_table.body.swap(src_func.body);
100 in_dest_symbol_table.parameter_identifiers.swap(
101 src_func.parameter_identifiers);
102 in_dest_symbol_table.type=src_func.type;
104 else if(src_func.body.instructions.empty() ||
105 src_ns.
lookup(src_it->first).is_weak)
116 rename_symbol(src_func.type);
118 "linking ensures that types match");
126 for(
const auto &symbol_pair : dest_symbol_table.
symbols)
128 if(symbol_pair.second.is_macro && !symbol_pair.second.is_type)
130 const symbolt &symbol = symbol_pair.second;
138 std::cerr << symbol <<
'\n';
139 std::cerr << ns.
lookup(
id) <<
'\n';
149 if(!macro_application.
expr_map.empty())
156 if(!object_type_updates.
empty())
161 iit->transform([&object_type_updates](
exprt expr) {
162 object_type_updates(expr);
176 std::unordered_set<irep_idt> weak_symbols;
180 if(symbol_pair.second.is_weak)
181 weak_symbols.insert(symbol_pair.first);