if (symtab->dump_file)
{
-
fprintf (symtab->dump_file, "updating call of %s -> %s: ",
e->caller->dump_name (), e->callee->dump_name ());
print_gimple_stmt (symtab->dump_file, e->call_stmt, 0, dump_flags);
if (callee_info && callee_info->param_adjustments)
callee_info->param_adjustments->dump (symtab->dump_file);
unsigned performed_len
- = vec_safe_length (caller_info->performed_splits);
+ = caller_info ? vec_safe_length (caller_info->performed_splits) : 0;
if (performed_len > 0)
fprintf (symtab->dump_file, "Performed splits records:\n");
for (unsigned i = 0; i < performed_len; i++)
void
cgraph_node::remove (void)
{
+ bool clone_info_set = false;
+ clone_info *info, saved_info;
if (symtab->ipa_clones_dump_file && symtab->cloned_nodes.contains (this))
fprintf (symtab->ipa_clones_dump_file,
"Callgraph removal;%s;%d;%s;%d;%d\n", asm_name (), order,
DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
DECL_SOURCE_COLUMN (decl));
+ if ((info = clone_info::get (this)) != NULL)
+ {
+ saved_info = *info;
+ clone_info_set = true;
+ }
symtab->call_cgraph_removal_hooks (this);
remove_callers ();
remove_callees ();
force_output = false;
forced_by_abi = false;
- unregister ();
+ unregister (clone_info_set ? &saved_info : NULL);
if (prev_sibling_clone)
prev_sibling_clone->next_sibling_clone = next_sibling_clone;
else if (clone_of)
/* Remove node from symbol table. This function is not used directly, but via
cgraph/varpool node removal routines. */
- void unregister (void);
+ void unregister (struct clone_info *);
/* Return the initialization and finalization priority information for
DECL. If there is no previous priority information, a freshly
/* cgraph node being removed from symbol table; see if its entry can be
replaced by other inline clone. */
- cgraph_node *find_replacement (void);
+ cgraph_node *find_replacement (struct clone_info *);
/* Create a new cgraph node which is the new version of
callgraph node. REDIRECT_CALLERS holds the callers
}
/* callgraph node being removed from symbol table; see if its entry can be
- replaced by other inline clone. */
+ replaced by other inline clone.
+ INFO is clone info to attach to the new root. */
cgraph_node *
-cgraph_node::find_replacement (void)
+cgraph_node::find_replacement (clone_info *info)
{
cgraph_node *next_inline_clone, *replacement;
clones = NULL;
/* Copy clone info. */
- clone_info *info = clone_info::get (this);
if (info)
*clone_info::get_create (next_inline_clone) = *info;
public:
clone_infos_t (symbol_table *table, bool ggc):
function_summary<clone_info *> (table, ggc) { }
-
- /* Hook that is called by summary when a node is duplicated. */
- virtual void duplicate (cgraph_node *node,
- cgraph_node *node2,
- clone_info *data,
- clone_info *data2);
};
-/* Duplication hook. */
-void
-clone_infos_t::duplicate (cgraph_node *, cgraph_node *,
- clone_info *src, clone_info *dst)
-{
- *dst = *src;
-}
-
} /* anon namespace */
/* Return thunk_info possibly creating new one. */
if (!symtab->m_clones)
{
symtab->m_clones
- = new (ggc_alloc_no_dtor <clone_infos_t> ())
- clone_infos_t (symtab, true);
+ = new (ggc_alloc_no_dtor <function_summary <clone_info *>> ())
+ function_summary <clone_info *> (symtab, true);
symtab->m_clones->disable_insertion_hook ();
symtab->m_clones->disable_duplication_hook ();
}
}
/* Remove node from symbol table. This function is not used directly, but via
- cgraph/varpool node removal routines. */
+ cgraph/varpool node removal routines.
+ INFO is a clone info to attach to new root of clone tree (if any). */
void
-symtab_node::unregister (void)
+symtab_node::unregister (clone_info *info)
{
remove_all_references ();
remove_all_referring ();
{
symtab_node *replacement_node = NULL;
if (cgraph_node *cnode = dyn_cast <cgraph_node *> (this))
- replacement_node = cnode->find_replacement ();
+ replacement_node = cnode->find_replacement (info);
decl->decl_with_vis.symtab_node = replacement_node;
}
if (!is_a <varpool_node *> (this) || !DECL_HARD_REGISTER (decl))
&& !ctor_useable_for_folding_p ())
remove_initializer ();
- unregister ();
+ unregister (NULL);
ggc_free (this);
}