void lto_symtab_merge_decls (void) { symtab_node node; /* Populate assembler name hash. */ symtab_initialize_asm_name_hash (); FOR_EACH_SYMBOL (node) if (!node->symbol.previous_sharing_asm_name && node->symbol.next_sharing_asm_name) lto_symtab_merge_decls_1 (node); }
void lto_symtab_merge_symbols (void) { symtab_node node; if (!flag_ltrans) { symtab_initialize_asm_name_hash (); /* Do the actual merging. At this point we invalidate hash translating decls into symtab nodes because after removing one of duplicate decls the hash is not correcly updated to the ohter dupliate. */ FOR_EACH_SYMBOL (node) if (lto_symtab_symbol_p (node) && node->symbol.next_sharing_asm_name && !node->symbol.previous_sharing_asm_name) lto_symtab_merge_symbols_1 (node); /* Resolve weakref aliases whose target are now in the compilation unit. also re-populate the hash translating decls into symtab nodes*/ FOR_EACH_SYMBOL (node) { cgraph_node *cnode, *cnode2; if (!node->symbol.analyzed && node->symbol.alias_target) { symtab_node tgt = symtab_node_for_asm (node->symbol.alias_target); gcc_assert (node->symbol.weakref); if (tgt) symtab_resolve_alias (node, tgt); } node->symbol.aux = NULL; if (!(cnode = dyn_cast <cgraph_node> (node)) || !cnode->clone_of || cnode->clone_of->symbol.decl != cnode->symbol.decl) { if (cnode && DECL_BUILT_IN (node->symbol.decl) && (cnode2 = cgraph_get_node (node->symbol.decl)) && cnode2 != cnode) lto_cgraph_replace_node (cnode2, cnode); symtab_insert_node_to_hashtable ((symtab_node)node); } } }
symtab_node symtab_node_for_asm (const_tree asmname) { symtab_node node; void **slot; symtab_initialize_asm_name_hash (); slot = htab_find_slot_with_hash (assembler_name_hash, asmname, decl_assembler_name_hash (asmname), NO_INSERT); if (slot) { node = (symtab_node) *slot; return node; } return NULL; }