summaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-01 06:35:08 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-01 06:35:08 +0000
commita30fe044170c44da9e441535e2167ca8e885b3cb (patch)
tree2ebaaed9567b6d2c562b45ef1d92bcb5cb136795 /gcc/cgraphunit.c
parentddda25955ee583217ccbd7ad5c33c6bb9f304649 (diff)
downloadgcc-a30fe044170c44da9e441535e2167ca8e885b3cb.tar.gz
2008-09-01 Basile Starynkevitch <basile@starynkevitch.net>
MERGED WITH TRUNK rev139820 * gcc/melt/warmelt-first.bysl: added location argument to inform. * gcc/warmelt-first-0.c: regenerated. * gcc/warmelt-macro-0.c: regenerated. * gcc/warmelt-normal-0.c: regenerated. * gcc/warmelt-genobj-0.c: regenerated. * gcc/warmelt-outobj-0.c: regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@139849 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index ae3dee417da..43cdfda3aa3 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -434,6 +434,7 @@ cgraph_process_new_functions (void)
gcc_unreachable ();
break;
}
+ cgraph_call_function_insertion_hooks (node);
}
return output;
}
@@ -1495,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;
@@ -1511,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. */
@@ -1520,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);
@@ -1535,6 +1542,7 @@ cgraph_function_versioning (struct cgraph_node *old_version_node,
new_version_node->local.externally_visible = 0;
new_version_node->local.local = 1;
new_version_node->lowered = true;
+ cgraph_call_function_insertion_hooks (new_version_node);
return new_version_node;
}
@@ -1558,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;