aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2009-07-20 14:15:02 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2009-07-20 14:15:02 +0200
commit08ad1d6d82e6531a00d773bc3f24548b98c1f89a (patch)
tree7ffb62e406ff8a8c4d6703fbbf79fddf2716b7aa /gcc/tree-inline.c
parentc4023c1903e09ab3f83785b8d38ba9ffd7e295e9 (diff)
downloadgcc-08ad1d6d82e6531a00d773bc3f24548b98c1f89a.zip
gcc-08ad1d6d82e6531a00d773bc3f24548b98c1f89a.tar.gz
gcc-08ad1d6d82e6531a00d773bc3f24548b98c1f89a.tar.bz2
cgraph.h (combined_args_to_skip): New field.
2009-07-20 Jan Hubicka <jh@suse.cz> Martin Jambor <mjambor@suse.cz> * cgraph.h (combined_args_to_skip): New field. * cgraph.c (cgraph_create_virtual_clone): Properly handle combined_args_to_skip and args_to_skip. * tree-inline.c (update_clone_info): New function. (tree_function_versioning): Call update_clone_info. * cgraphunit.c: (cgraph_materialize_clone): Dump materialized functions. (cgraph_materialize_all_clones): More extensive dumping, working with combined_args_to_skip rather than args_to_skip. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r149808
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index a28f0a4..8b5e1ff 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -4446,6 +4446,42 @@ delete_unreachable_blocks_update_callgraph (copy_body_data *id)
return changed;
}
+/* Update clone info after duplication. */
+
+static void
+update_clone_info (copy_body_data * id)
+{
+ struct cgraph_node *node;
+ if (!id->dst_node->clones)
+ return;
+ for (node = id->dst_node->clones; node != id->dst_node;)
+ {
+ /* First update replace maps to match the new body. */
+ if (node->clone.tree_map)
+ {
+ unsigned int i;
+ for (i = 0; i < VEC_length (ipa_replace_map_p, node->clone.tree_map); i++)
+ {
+ struct ipa_replace_map *replace_info;
+ replace_info = VEC_index (ipa_replace_map_p, node->clone.tree_map, i);
+ walk_tree (&replace_info->old_tree, copy_tree_body_r, id, NULL);
+ walk_tree (&replace_info->new_tree, copy_tree_body_r, id, NULL);
+ }
+ }
+ if (node->clones)
+ node = node->clones;
+ else if (node->next_sibling_clone)
+ node = node->next_sibling_clone;
+ else
+ {
+ while (node != id->dst_node && !node->next_sibling_clone)
+ node = node->clone_of;
+ if (node != id->dst_node)
+ node = node->next_sibling_clone;
+ }
+ }
+}
+
/* Create a copy of a function's tree.
OLD_DECL and NEW_DECL are FUNCTION_DECL tree nodes
of the original function and the new copied function
@@ -4602,6 +4638,7 @@ tree_function_versioning (tree old_decl, tree new_decl,
while (VEC_length (gimple, init_stmts))
insert_init_stmt (bb, VEC_pop (gimple, init_stmts));
}
+ update_clone_info (&id);
/* Remap the nonlocal_goto_save_area, if any. */
if (cfun->nonlocal_goto_save_area)