notice_global_symbol (decl);
node->local.finalized = true;
node->lowered = DECL_STRUCT_FUNCTION (decl)->cfg != NULL;
+ node->finalized_by_frontend = true;
record_cdtor_fn (node->decl);
if (node->nested)
lower_nested_functions (decl);
gcc_assert (node->lowered);
/* Generate RTL for the body of DECL. */
- if (lang_hooks.callgraph.emit_associated_thunks)
+ if (lang_hooks.callgraph.emit_associated_thunks
+ && node->finalized_by_frontend)
lang_hooks.callgraph.emit_associated_thunks (decl);
tree_rest_of_compilation (decl);
/* This is used to sort the node types by the cgraph order number. */
+enum cgraph_order_sort_kind
+{
+ ORDER_UNDEFINED = 0,
+ ORDER_FUNCTION,
+ ORDER_VAR,
+ ORDER_ASM
+};
+
struct cgraph_order_sort
{
- enum { ORDER_UNDEFINED = 0, ORDER_FUNCTION, ORDER_VAR, ORDER_ASM } kind;
+ enum cgraph_order_sort_kind kind;
union
{
struct cgraph_node *f;
sprintf (which_buf, "%c_%.5d_%d", which, priority, counter++);
name = get_file_function_name (which_buf);
- decl = build_decl (FUNCTION_DECL, name,
+ decl = build_decl (input_location, FUNCTION_DECL, name,
build_function_type (void_type_node, void_list_node));
current_function_decl = decl;
- resdecl = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
+ resdecl = build_decl (input_location,
+ RESULT_DECL, NULL_TREE, void_type_node);
DECL_ARTIFICIAL (resdecl) = 1;
DECL_RESULT (decl) = resdecl;
DECL_CONTEXT (resdecl) = decl;
??? We cannot use COMDAT linkage because there is no
ABI support for this. */
DECL_EXTERNAL (new_version_node->decl) = 0;
- DECL_ONE_ONLY (new_version_node->decl) = 0;
+ DECL_COMDAT_GROUP (new_version_node->decl) = NULL_TREE;
TREE_PUBLIC (new_version_node->decl) = 0;
DECL_COMDAT (new_version_node->decl) = 0;
DECL_WEAK (new_version_node->decl) = 0;
tree_function_versioning (node->decl, first_clone->decl, NULL, true, NULL);
DECL_EXTERNAL (first_clone->decl) = 0;
- DECL_ONE_ONLY (first_clone->decl) = 0;
+ DECL_COMDAT_GROUP (first_clone->decl) = NULL_TREE;
TREE_PUBLIC (first_clone->decl) = 0;
DECL_COMDAT (first_clone->decl) = 0;
+ VEC_free (ipa_opt_pass, heap,
+ DECL_STRUCT_FUNCTION (first_clone->decl)->ipa_transforms_to_apply);
+ DECL_STRUCT_FUNCTION (first_clone->decl)->ipa_transforms_to_apply = NULL;
#ifdef ENABLE_CHECKING
verify_cgraph_node (first_clone);
for (e = node->callees; e; e = e->next_callee)
{
tree decl = gimple_call_fndecl (e->call_stmt);
- if (decl != e->callee->decl)
+ /* When function gets inlined, indirect inlining might've invented
+ new edge for orginally indirect stmt. Since we are not
+ preserving clones in the original form, we must not update here
+ since other inline clones don't need to contain call to the same
+ call. Inliner will do the substitution for us later. */
+ if (decl && decl != e->callee->decl)
{
gimple new_stmt;
gimple_stmt_iterator gsi;
verify_cgraph_node (node);
#endif
}
+#ifdef ENABLE_CHECKING
+ verify_cgraph ();
+#endif
cgraph_remove_unreachable_nodes (false, cgraph_dump_file);
}