diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2008-04-03 05:41:57 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2008-04-03 05:41:57 +0000 |
commit | 9ff420f135551a6d3582b986997ef78ac6762f56 (patch) | |
tree | 452e7c06ff6f1f3a8357898f7dcdc5ae66011637 /gcc/cp | |
parent | d2784db4e5b1950ca24582e3dd716af7f5e04906 (diff) | |
download | gcc-9ff420f135551a6d3582b986997ef78ac6762f56.zip gcc-9ff420f135551a6d3582b986997ef78ac6762f56.tar.gz gcc-9ff420f135551a6d3582b986997ef78ac6762f56.tar.bz2 |
tree-inline.c (copy_generic_body, [...]): Export.
2007-03-09 Paolo Bonzini <bonzini@gnu.org>
* tree-inline.c (copy_generic_body, copy_decl_no_change): Export.
(remap_block): Call id->transform_lang_insert_block instead
of langhook.
(optimize_inline_calls, unsave_expr_now, tree_function_versioning):
Set id.transform_lang_insert_block to NULL.
(clone_body): Move to cp/optimize.c
* tree-inline.h (struct copy_body_data): Change
transform_lang_insert_block to function pointer.
(copy_generic_body, copy_decl_no_change): Export.
* langhooks.h (struct lang_hooks_for_decls): Kill insert_block.
* langhooks-def.h (LANG_HOOKS_INSERT_BLOCK): Kill.
(LANG_HOOKS_DECLS): Remove LANG_HOOKS_INSERT_BLOCK.
* c-tree.h (insert_block): Kill.
* c-decl.c (insert_block): Kill.
cp:
2007-03-09 Paolo Bonzini <bonzini@gnu.org>
* optimize.c (clone_body): New, from tree-inline.c.
ada:
2007-03-09 Paolo Bonzini <bonzini@gnu.org>
* gigi.h (insert_block): Kill.
* utils.c (insert_block): Kill.
java:
2007-03-09 Paolo Bonzini <bonzini@gnu.org>
* java-tree.h (insert_block): Kill.
* decl.c (insert_block): Kill.
fortran:
2007-03-09 Paolo Bonzini <bonzini@gnu.org>
* f95-lang.c (insert_block): Kill.
From-SVN: r133861
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/optimize.c | 31 |
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6aaf392..5b6c498 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,4 +1,8 @@ 2008-04-03 Paolo Bonzini <bonzini@gnu.org> + + * optimize.c (clone_body): New, from tree-inline.c. + +2008-04-03 Paolo Bonzini <bonzini@gnu.org> * method.c (synthesize_method): Use {push,pop}_function_context. * name-lookup.c (push_to_top_level): Likewise. diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index 0f50173..2ffbd6f 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -72,6 +72,37 @@ update_cloned_parm (tree parm, tree cloned_parm, bool first) DECL_GIMPLE_REG_P (cloned_parm) = DECL_GIMPLE_REG_P (parm); } +/* FN is a function that has a complete body, and CLONE is a function whose + body is to be set to a copy of FN, mapping argument declarations according + to the ARG_MAP splay_tree. */ + +static void +clone_body (tree clone, tree fn, void *arg_map) +{ + copy_body_data id; + + /* Clone the body, as if we were making an inline call. But, remap the + parameters in the callee to the parameters of caller. */ + memset (&id, 0, sizeof (id)); + id.src_fn = fn; + id.dst_fn = clone; + id.src_cfun = DECL_STRUCT_FUNCTION (fn); + id.decl_map = (struct pointer_map_t *)arg_map; + + id.copy_decl = copy_decl_no_change; + id.transform_call_graph_edges = CB_CGE_DUPLICATE; + id.transform_new_cfg = true; + id.transform_return_to_modify = false; + id.transform_lang_insert_block = insert_block; + + /* We're not inside any EH region. */ + id.eh_region = -1; + + /* Actually copy the body. */ + append_to_statement_list_force (copy_generic_body (&id), + &DECL_SAVED_TREE (clone)); +} + /* FN is a function that has a complete body. Clone the body as necessary. Returns nonzero if there's no longer any need to process the main body. */ |