aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2008-08-29 13:31:40 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2008-08-29 11:31:40 +0000
commitc6f7cfc15e7480f86aa3e4d407932f38fd635c89 (patch)
treed057c22936747f4672fd349b48d59df2628ab832 /gcc/gimple.c
parentefd8f7507b3ce6e4cc00c7eac4f011736ca4f14d (diff)
downloadgcc-c6f7cfc15e7480f86aa3e4d407932f38fd635c89.zip
gcc-c6f7cfc15e7480f86aa3e4d407932f38fd635c89.tar.gz
gcc-c6f7cfc15e7480f86aa3e4d407932f38fd635c89.tar.bz2
tree.c (build_function_type_skip_args, [...]): New functions.
* 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. From-SVN: r139761
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index c651f0d..6e203b7 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3180,4 +3180,37 @@ canonicalize_cond_expr_cond (tree t)
return NULL_TREE;
}
+/* Build call same as STMT but skipping arguments ARGS_TO_SKIP. */
+gimple
+giple_copy_call_skip_args (gimple stmt, bitmap args_to_skip)
+{
+ int i;
+ tree fn = gimple_call_fn (stmt);
+ int nargs = gimple_call_num_args (stmt);
+ VEC(tree, heap) *vargs = VEC_alloc (tree, heap, nargs);
+ gimple new_stmt;
+
+ for (i = 0; i < nargs; i++)
+ if (!bitmap_bit_p (args_to_skip, i))
+ VEC_quick_push (tree, vargs, gimple_call_arg (stmt, i));
+
+ new_stmt = gimple_build_call_vec (fn, vargs);
+ VEC_free (tree, heap, vargs);
+ if (gimple_call_lhs (stmt))
+ gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
+
+ gimple_set_block (new_stmt, gimple_block (stmt));
+ if (gimple_has_location (stmt))
+ gimple_set_location (new_stmt, gimple_location (stmt));
+
+ /* Carry all the flags to the new GIMPLE_CALL. */
+ gimple_call_set_chain (new_stmt, gimple_call_chain (stmt));
+ gimple_call_set_tail (new_stmt, gimple_call_tail_p (stmt));
+ gimple_call_set_cannot_inline (new_stmt, gimple_call_cannot_inline_p (stmt));
+ gimple_call_set_return_slot_opt (new_stmt, gimple_call_return_slot_opt_p (stmt));
+ gimple_call_set_from_thunk (new_stmt, gimple_call_from_thunk_p (stmt));
+ gimple_call_set_va_arg_pack (new_stmt, gimple_call_va_arg_pack_p (stmt));
+ return new_stmt;
+}
+
#include "gt-gimple.h"