14 #include <unordered_set>
31 rename_symbol(
function.type);
35 rename_symbol(iit->code);
36 rename_symbol(iit->guard);
39 iit->function=new_function_name;
51 const std::unordered_set<irep_idt> &weak_symbols,
61 rename_symbolt::expr_mapt::const_iterator e_it=
62 rename_symbol.
expr_map.find(src_it->first);
66 if(e_it!=rename_symbol.
expr_map.end())
67 final_id=e_it->second;
70 goto_functionst::function_mapt::iterator dest_f_it=
77 dest_functions.
function_map.emplace(final_id, std::move(src_func));
83 if(in_dest_symbol_table.body.instructions.empty() ||
84 weak_symbols.find(final_id)!=weak_symbols.end())
89 in_dest_symbol_table.body.swap(src_func.body);
90 in_dest_symbol_table.type=src_func.type;
92 else if(src_func.body.instructions.empty() ||
93 src_ns.
lookup(src_it->first).is_weak)
97 else if(in_dest_symbol_table.type.get_bool(ID_C_inlined))
104 rename_symbol(src_func.type);
106 "linking ensures that types match");
114 for(
const auto &symbol_pair : dest_symbol_table.
symbols)
116 if(symbol_pair.second.is_macro && !symbol_pair.second.is_type)
118 const symbolt &symbol = symbol_pair.second;
126 std::cerr << symbol <<
'\n';
127 std::cerr << ns.
lookup(
id) <<
'\n';
137 if(!macro_application.
expr_map.empty())
144 if(!object_type_updates.
empty())
149 object_type_updates(iit->code);
150 object_type_updates(iit->guard);
162 std::unordered_set<irep_idt> weak_symbols;
166 if(symbol_pair.second.is_weak)
167 weak_symbols.insert(symbol_pair.first);