diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-29 11:31:40 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-29 11:31:40 +0000 |
commit | 5afe38fe4c359548ac69898c28c2511a6f341d96 (patch) | |
tree | d057c22936747f4672fd349b48d59df2628ab832 /gcc/cgraphunit.c | |
parent | 0bfd8d5c472a9e897b1f5636d4bc1a69a0fe6251 (diff) | |
download | gcc-5afe38fe4c359548ac69898c28c2511a6f341d96.tar.gz |
* tree.c (build_function_type_skip_args, build_function_decl_skip_args):
New functions.
* tree.h (build_function_type_skip_args, build_function_decl_skip_args):
Declare.
* gimple.c (giple_copy_call_skip_args): New function.
(giple_copy_call_skip_args): Declare.
* cgraph.h (cgraph_function_versioning): Add skip_args arugmnet
* ipa-cp.c (ipcp_node_not_modifiable_p): Rename to ...
(ipcp_node_modifiable_p): ... this one; use tree_versionable_function_p.
(ipcp_create_replace_map): Improve debug output.
(ipcp_need_redirect_p): Return false when not clonning.
(ipcp_update_callgraph): Skip args.
(ipcp_insert_stage): UPdate call of !ipcp_node_modifiable_p;
skip args.
* cgraphunit.c (cgraph_function_versioning): Add skip_args argument.
(save_inline_function_body): Update call of tree_function_versioning.
* ipa-prop.c (ipa_edge_removal_hook): Do not ICE on unanalyzed nodes.
* tree-inline.c (copy_arguments_for_versioning): Add skip_args argument.
(tree_function_versioning): Likewise.
* tree-inline.h (tree_function_versioning): Update prototype.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139761 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 371e17cc99f..43cdfda3aa3 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1496,12 +1496,15 @@ cgraph_copy_node_for_versioning (struct cgraph_node *old_version, TREE_MAP is a mapping of tree nodes we want to replace with new ones (according to results of prior analysis). OLD_VERSION_NODE is the node that is versioned. - It returns the new version's cgraph node. */ + It returns the new version's cgraph node. + ARGS_TO_SKIP lists arguments to be omitted from functions + */ struct cgraph_node * cgraph_function_versioning (struct cgraph_node *old_version_node, VEC(cgraph_edge_p,heap) *redirect_callers, - varray_type tree_map) + varray_type tree_map, + bitmap args_to_skip) { tree old_decl = old_version_node->decl; struct cgraph_node *new_version_node = NULL; @@ -1512,7 +1515,10 @@ cgraph_function_versioning (struct cgraph_node *old_version_node, /* Make a new FUNCTION_DECL tree node for the new version. */ - new_decl = copy_node (old_decl); + if (!args_to_skip) + new_decl = copy_node (old_decl); + else + new_decl = build_function_decl_skip_args (old_decl, args_to_skip); /* Create the new version's call-graph node. and update the edges of the new node. */ @@ -1521,7 +1527,7 @@ cgraph_function_versioning (struct cgraph_node *old_version_node, redirect_callers); /* Copy the OLD_VERSION_NODE function tree to the new version. */ - tree_function_versioning (old_decl, new_decl, tree_map, false); + tree_function_versioning (old_decl, new_decl, tree_map, false, args_to_skip); /* Update the call_expr on the edges to call the new version node. */ update_call_expr (new_version_node); @@ -1560,7 +1566,7 @@ save_inline_function_body (struct cgraph_node *node) gcc_assert (first_clone == cgraph_node (first_clone->decl)); /* Copy the OLD_VERSION_NODE function tree to the new version. */ - tree_function_versioning (node->decl, first_clone->decl, NULL, true); + tree_function_versioning (node->decl, first_clone->decl, NULL, true, NULL); DECL_EXTERNAL (first_clone->decl) = 0; DECL_ONE_ONLY (first_clone->decl) = 0; |