Lines Matching defs:prevailing
304 /* Merge two variable or function symbol table entries PREVAILING and ENTRY.
309 lto_symtab_merge (symtab_node *prevailing, symtab_node *entry)
311 tree prevailing_decl = prevailing->decl;
423 /* Return true if the symtab entry E can be the prevailing one. */
447 symtab_node *prevailing = NULL;
456 prevailing = e;
461 if (prevailing)
467 for (e = prevailing->next_sharing_asm_name; e; e = e->next_sharing_asm_name)
469 && !DECL_COMMON (prevailing->decl)
474 fatal_error (input_location, "multiple prevailing defs for %qE",
475 DECL_NAME (prevailing->decl));
476 return prevailing;
479 /* Find the single non-replaceable prevailing symbol and
489 if (prevailing)
493 inform (DECL_SOURCE_LOCATION (prevailing->decl),
496 prevailing = e;
499 if (prevailing)
500 return prevailing;
502 /* Do a second round choosing one from the replaceable prevailing decls. */
508 /* Choose the first function that can prevail as prevailing. */
511 prevailing = e;
516 if (!prevailing
517 || tree_int_cst_lt (DECL_SIZE (prevailing->decl),
528 || (DECL_SIZE (prevailing->decl) == DECL_SIZE (e->decl)
531 && (!DECL_INITIAL (prevailing->decl)
532 || DECL_INITIAL (prevailing->decl) == error_mark_node)))
533 prevailing = e;
536 return prevailing;
539 /* Decide if it is OK to merge DECL into PREVAILING.
544 lto_symtab_merge_p (tree prevailing, tree decl)
546 if (TREE_CODE (prevailing) != TREE_CODE (decl))
553 gcc_checking_assert (TREE_CHAIN (prevailing) == TREE_CHAIN (decl));
555 if (TREE_CODE (prevailing) == FUNCTION_DECL)
557 if (fndecl_built_in_p (prevailing) != fndecl_built_in_p (decl))
564 if (fndecl_built_in_p (prevailing)
565 && (DECL_BUILT_IN_CLASS (prevailing) != DECL_BUILT_IN_CLASS (decl)
566 || (DECL_UNCHECKED_FUNCTION_CODE (prevailing)
576 if (DECL_ATTRIBUTES (prevailing) != DECL_ATTRIBUTES (decl))
578 tree prev_attr = lookup_attribute ("error", DECL_ATTRIBUTES (prevailing));
589 prev_attr = lookup_attribute ("warning", DECL_ATTRIBUTES (prevailing));
600 prev_attr = lookup_attribute ("noreturn", DECL_ATTRIBUTES (prevailing));
613 /* Merge all decls in the symbol table chain to the prevailing decl and
620 symtab_node *prevailing;
628 prevailing = first;
629 if (!prevailing->next_sharing_asm_name)
632 /* Try to merge each entry with the prevailing one. */
633 symtab_node *last_prevailing = prevailing, *next;
634 for (e = prevailing->next_sharing_asm_name; e; e = next)
642 || e->decl == prevailing->decl)
645 if (!lto_symtab_merge (prevailing, e)
651 for (this_prevailing = prevailing; ;
670 else if (e == prevailing->next_sharing_asm_name)
679 e->previous_sharing_asm_name = prevailing;
680 e->next_sharing_asm_name = prevailing->next_sharing_asm_name;
681 prevailing->next_sharing_asm_name->previous_sharing_asm_name = e;
682 prevailing->next_sharing_asm_name = e;
683 if (last_prevailing == prevailing)
697 if (DECL_IS_UNDECLARED_BUILTIN (prevailing->decl)
701 int level = warn_type_compatibility_p (TREE_TYPE (prevailing->decl),
730 warn_types_mismatch (TREE_TYPE (prevailing->decl),
732 DECL_SOURCE_LOCATION (prevailing->decl),
735 && !TREE_READONLY (prevailing->decl))
740 else if ((DECL_USER_ALIGN (prevailing->decl)
742 && DECL_ALIGN (prevailing->decl) < DECL_ALIGN (decl))
756 inform (DECL_SOURCE_LOCATION (prevailing->decl),
757 "%qD was previously declared here", prevailing->decl);
759 inform (DECL_SOURCE_LOCATION (prevailing->decl),
772 symtab_node *prevailing;
786 prevailing = lto_symtab_resolve_symbols (first);
788 /* If there's not a prevailing symbol yet it's an external reference.
791 if (!prevailing)
793 for (prevailing = first;
794 prevailing; prevailing = prevailing->next_sharing_asm_name)
795 if (lto_symtab_symbol_p (prevailing))
797 if (!prevailing)
806 if (TREE_CODE (prevailing->decl) == VAR_DECL)
808 for (e = prevailing->next_sharing_asm_name;
810 if (!COMPLETE_TYPE_P (TREE_TYPE (prevailing->decl))
813 prevailing = e;
816 else if (TREE_CODE (prevailing->decl) == FUNCTION_DECL)
823 prevailing = e;
829 symtab->symtab_prevail_in_asm_name_hash (prevailing);
832 for (e = prevailing->next_sharing_asm_name;
835 if (TREE_CODE (prevailing->decl)
841 switch (TREE_CODE (prevailing->decl))
847 prevailing->decl);
854 prevailing->decl);
864 inform (DECL_SOURCE_LOCATION (prevailing->decl),
867 /* Merge the chain to the single prevailing decl and diagnose
869 lto_symtab_merge_decls_2 (prevailing, diagnosed_p);
874 for (e = prevailing; e; e = e->next_sharing_asm_name)
879 /* Resolve and merge all symbol table chains to a prevailing decl. */
905 lto_symtab_merge_symbols_1 (symtab_node *prevailing)
910 prevailing->decl->decl_with_vis.symtab_node = prevailing;
912 /* Replace the cgraph node of each entry with the prevailing one. */
913 for (e = prevailing->next_sharing_asm_name; e;
925 use prevailing definition. */
927 ipa_merge_profiles (dyn_cast<cgraph_node *> (prevailing),
965 e->resolve_alias (prevailing, true);
966 gcc_assert (e != prevailing);