Lines Matching defs:decl

56 		 (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl)))));
70 && DECL_COMDAT (node->decl) && DECL_COMDAT (prevailing_node->decl))
73 && DECL_DECLARED_INLINE_P (node->decl)
74 && DECL_EXTERNAL (node->decl)
82 = types_compatible_p (TREE_TYPE (TREE_TYPE (prevailing_node->decl)),
83 TREE_TYPE (TREE_TYPE (node->decl)));
102 if (node->decl != prevailing_node->decl)
126 if (DECL_INITIAL (vnode->decl)
127 && vnode->decl != prevailing_node->decl)
128 DECL_INITIAL (vnode->decl) = error_mark_node;
131 if (DECL_VIRTUAL_P (vnode->decl) || DECL_VIRTUAL_P (prevailing_node->decl))
168 error_at (DECL_SOURCE_LOCATION (vnode->decl),
169 "%qD is defined with tls model %s", vnode->decl, tls_model_names [vnode->tls_model]);
170 inform (DECL_SOURCE_LOCATION (prevailing_node->decl),
311 tree prevailing_decl = prevailing->decl;
312 tree decl = entry->decl;
314 if (prevailing_decl == decl)
317 if (TREE_CODE (decl) != TREE_CODE (prevailing_decl))
320 /* Merge decl state in both directions, we may still end up using
321 the new decl. */
322 TREE_ADDRESSABLE (prevailing_decl) |= TREE_ADDRESSABLE (decl);
323 TREE_ADDRESSABLE (decl) |= TREE_ADDRESSABLE (prevailing_decl);
328 if (TREE_CODE (decl) == FUNCTION_DECL)
330 /* Merge decl state in both directions, we may still end up using
331 the new decl. */
332 DECL_POSSIBLY_INLINED (prevailing_decl) |= DECL_POSSIBLY_INLINED (decl);
333 DECL_POSSIBLY_INLINED (decl) |= DECL_POSSIBLY_INLINED (prevailing_decl);
336 TREE_TYPE (decl),
337 DECL_COMMON (decl)
338 || DECL_EXTERNAL (decl)))
345 TREE_TYPE (decl),
346 DECL_COMMON (decl) || DECL_EXTERNAL (decl)))
357 if ((DECL_USER_ALIGN (prevailing_decl) && DECL_USER_ALIGN (decl))
358 && DECL_ALIGN (prevailing_decl) < DECL_ALIGN (decl))
361 if (DECL_SIZE (decl) && DECL_SIZE (prevailing_decl)
362 && !tree_int_cst_equal (DECL_SIZE (decl), DECL_SIZE (prevailing_decl)))
364 if (!DECL_COMMON (decl) && !DECL_EXTERNAL (decl))
367 tree type = TREE_TYPE (decl);
398 if (DECL_EXTERNAL (e->decl)
399 || DECL_COMDAT (e->decl)
400 || DECL_ONE_ONLY (e->decl)
401 || DECL_WEAK (e->decl))
404 if (TREE_CODE (e->decl) == VAR_DECL)
405 return (DECL_COMMON (e->decl)
406 || (!flag_no_common && !DECL_INITIAL (e->decl)));
418 if (!TREE_PUBLIC (e->decl) && !DECL_EXTERNAL (e->decl))
434 if (DECL_EXTERNAL (e->decl))
449 /* Always set e->node so that edges are updated to reflect decl merging. */
469 && !DECL_COMMON (prevailing->decl)
470 && !DECL_COMMON (e->decl)
475 DECL_NAME (prevailing->decl));
491 error_at (DECL_SOURCE_LOCATION (e->decl),
492 "%qD has already been defined", e->decl);
493 inform (DECL_SOURCE_LOCATION (prevailing->decl),
509 if (TREE_CODE (e->decl) == FUNCTION_DECL)
517 || tree_int_cst_lt (DECL_SIZE (prevailing->decl),
518 DECL_SIZE (e->decl))
528 || (DECL_SIZE (prevailing->decl) == DECL_SIZE (e->decl)
529 && (DECL_INITIAL (e->decl)
530 && DECL_INITIAL (e->decl) != error_mark_node)
531 && (!DECL_INITIAL (prevailing->decl)
532 || DECL_INITIAL (prevailing->decl) == error_mark_node)))
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));
557 if (fndecl_built_in_p (prevailing) != fndecl_built_in_p (decl))
565 && (DECL_BUILT_IN_CLASS (prevailing) != DECL_BUILT_IN_CLASS (decl)
567 != DECL_UNCHECKED_FUNCTION_CODE (decl))))
576 if (DECL_ATTRIBUTES (prevailing) != DECL_ATTRIBUTES (decl))
579 tree attr = lookup_attribute ("error", DECL_ATTRIBUTES (decl));
590 attr = lookup_attribute ("warning", DECL_ATTRIBUTES (decl));
601 attr = lookup_attribute ("noreturn", DECL_ATTRIBUTES (decl));
613 /* Merge all decls in the symbol table chain to the prevailing decl and
624 tree decl;
640 if (lto_symtab_prevailing_decl (e->decl) != e->decl
642 || e->decl == prevailing->decl)
647 && !DECL_ARTIFICIAL (e->decl))
648 mismatches.safe_push (e->decl);
654 if (this_prevailing->decl != e->decl
655 && lto_symtab_merge_p (this_prevailing->decl, e->decl))
665 lto_symtab_prevail_decl (this_prevailing->decl, e->decl);
691 FOR_EACH_VEC_ELT (mismatches, i, decl)
697 if (DECL_IS_BUILTIN (prevailing->decl)
698 && DECL_IS_BUILTIN (decl))
701 int level = warn_type_compatibility_p (TREE_TYPE (prevailing->decl),
702 TREE_TYPE (decl),
703 DECL_COMDAT (decl));
712 if (TREE_CODE (decl) != FUNCTION_DECL
713 || TREE_CODE (TREE_TYPE (decl)) != METHOD_TYPE
714 || !TYPE_METHOD_BASETYPE (TREE_TYPE (decl))
715 || !odr_type_p (TYPE_METHOD_BASETYPE (TREE_TYPE (decl)))
717 (TYPE_METHOD_BASETYPE (TREE_TYPE (decl))))
718 diag = warning_at (DECL_SOURCE_LOCATION (decl),
721 decl);
724 diag = warning_at (DECL_SOURCE_LOCATION (decl),
727 "declaration", decl);
730 warn_types_mismatch (TREE_TYPE (prevailing->decl),
731 TREE_TYPE (decl),
732 DECL_SOURCE_LOCATION (prevailing->decl),
733 DECL_SOURCE_LOCATION (decl));
735 && !TREE_READONLY (prevailing->decl))
740 else if ((DECL_USER_ALIGN (prevailing->decl)
741 && DECL_USER_ALIGN (decl))
742 && DECL_ALIGN (prevailing->decl) < DECL_ALIGN (decl))
744 diagnosed_p |= warning_at (DECL_SOURCE_LOCATION (decl),
747 "original declaration", decl);
750 diagnosed_p |= warning_at (DECL_SOURCE_LOCATION (decl),
753 "original declaration", decl);
756 inform (DECL_SOURCE_LOCATION (prevailing->decl),
757 "%qD was previously declared here", prevailing->decl);
759 inform (DECL_SOURCE_LOCATION (prevailing->decl),
766 /* Helper to process the decl chain for the symbol table entry *SLOT. */
780 if (TREE_PUBLIC (e->decl))
806 if (TREE_CODE (prevailing->decl) == VAR_DECL)
810 if (!COMPLETE_TYPE_P (TREE_TYPE (prevailing->decl))
811 && COMPLETE_TYPE_P (TREE_TYPE (e->decl))
816 else if (TREE_CODE (prevailing->decl) == FUNCTION_DECL)
819 if (TREE_CODE (e->decl) == FUNCTION_DECL
820 && !fndecl_built_in_p (e->decl)
835 if (TREE_CODE (prevailing->decl)
836 == TREE_CODE (e->decl))
841 switch (TREE_CODE (prevailing->decl))
844 gcc_assert (TREE_CODE (e->decl) == FUNCTION_DECL);
845 error_at (DECL_SOURCE_LOCATION (e->decl),
847 prevailing->decl);
851 gcc_assert (TREE_CODE (e->decl) == VAR_DECL);
852 error_at (DECL_SOURCE_LOCATION (e->decl),
854 prevailing->decl);
864 inform (DECL_SOURCE_LOCATION (prevailing->decl),
867 /* Merge the chain to the single prevailing decl and diagnose
879 /* Resolve and merge all symbol table chains to a prevailing decl. */
902 /* Helper to process the decl chain for the symbol table entry *SLOT. */
910 prevailing->decl->decl_with_vis.symtab_node = prevailing;
919 if ((!TREE_PUBLIC (e->decl) && !DECL_EXTERNAL (e->decl))
922 symtab_node *to = symtab_node::get (lto_symtab_prevailing_decl (e->decl));
955 DECL_INITIAL (e->decl) = error_mark_node;
1013 && !DECL_EXTERNAL (node->decl)
1019 DECL_EXTERNAL (node->decl) = 1;
1049 || cnode->clone_of->decl != cnode->decl)
1051 /* Builtins are not merged via decl merging. It is however
1054 if (cnode && fndecl_built_in_p (node->decl)
1055 && (cnode2 = cgraph_node::get (node->decl))
1063 && DECL_HARD_REGISTER (vnode->decl)
1064 && (node2 = symtab_node::get (vnode->decl))
1072 else if (cnode && DECL_ABSTRACT_P (cnode->decl)
1073 && (cnode2 = cgraph_node::get (node->decl))
1077 node->decl->decl_with_vis.symtab_node = node;
1092 lto_symtab_prevailing_virtual_decl (tree decl)
1094 if (DECL_ABSTRACT_P (decl))
1095 return decl;
1097 if (type_in_anonymous_namespace_p (DECL_CONTEXT (decl)))
1099 return decl;
1101 gcc_checking_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
1104 (DECL_ASSEMBLER_NAME (decl));
1105 while (n && ((!DECL_EXTERNAL (n->decl) && !TREE_PUBLIC (n->decl))
1106 || !DECL_VIRTUAL_P (n->decl)))
1110 /* Merge decl state in both directions, we may still end up using
1111 the other decl. */
1112 TREE_ADDRESSABLE (n->decl) |= TREE_ADDRESSABLE (decl);
1113 TREE_ADDRESSABLE (decl) |= TREE_ADDRESSABLE (n->decl);
1115 if (TREE_CODE (decl) == FUNCTION_DECL)
1117 /* Merge decl state in both directions, we may still end up using
1118 the other decl. */
1119 DECL_POSSIBLY_INLINED (n->decl) |= DECL_POSSIBLY_INLINED (decl);
1120 DECL_POSSIBLY_INLINED (decl) |= DECL_POSSIBLY_INLINED (n->decl);
1122 lto_symtab_prevail_decl (n->decl, decl);
1123 decl = n->decl;
1126 symtab_node::get_create (decl);
1128 return decl;