diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-11 13:13:37 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-11 13:13:37 +0000 |
commit | 469679aba0e296a3f7635b30532d76ea6a433861 (patch) | |
tree | 7528e0c14251773ead6e3aa9eaaf90a59556ee1d /gcc/tree-optimize.c | |
parent | df738c1f721fd7482b0d2c122f8007b08c79f86a (diff) | |
download | gcc-469679aba0e296a3f7635b30532d76ea6a433861.tar.gz |
* cgraph.c (cgraph_insert_node_to_hashtable): New function.
* cgraph.h (cgraph_node): Add inline_decl.
(cgraph_insert_node_to_hashtable): Declare.
(save_inline_function_body): Declare.
* cgraphunit.c (verify_cgraph_node): Inline edges might point to inline
clones.
(cgraph_preserve_function_body_p): Do not presrve when dump is enabled.
(cgraph_function_versioning): Update call of tree_function_versioning.
(save_inline_function_body): New function.
* function.h (struct function): Kill saved_eh, saved_cfg, saved_args,
saved_static_chain_decl, saved_blocks and saved-unexpanded_var_list.
* ipa-inline.c (cgraph_mark_inline_edge): Look for inline clones.
(cgraph_default_inline_p): Likewise.
(cgraph_decide_inlining_incrementally): Likewise.
* tree-inline.c (inline_data): Kill saving_p add update_clones_p.
(copy_bb): Kill saving; do updating of clones.
(copy_cfg_body): Kill saving.
(initialize_inlined-parameters): Likewise.
(expand_call_inline): Likewise.
(save_body): Kill.
(tree_function_versioning): New parameter "update_clones".
(inlining_p): Kill saving.
* tree-inline.h (tree_function_versioning): Update prototype.
* tree-optimize.c (tree_rest_of_compilation): Use clonning instead of
saving.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109580 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-optimize.c')
-rw-r--r-- | gcc/tree-optimize.c | 64 |
1 files changed, 9 insertions, 55 deletions
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index 8bed9154d90..34f2d463077 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -348,12 +348,19 @@ void tree_rest_of_compilation (tree fndecl) { location_t saved_loc; - struct cgraph_node *saved_node = NULL, *node; + struct cgraph_node *node; timevar_push (TV_EXPAND); gcc_assert (!flag_unit_at_a_time || cgraph_global_info_ready); + node = cgraph_node (fndecl); + + /* We might need the body of this function so that we can expand + it inline somewhere else. */ + if (cgraph_preserve_function_body_p (fndecl)) + save_inline_function_body (node); + /* Initialize the RTL code for the function. */ current_function_decl = fndecl; saved_loc = input_location; @@ -367,26 +374,6 @@ tree_rest_of_compilation (tree fndecl) cfun->x_dont_save_pending_sizes_p = 1; cfun->after_inlining = true; - node = cgraph_node (fndecl); - - /* We might need the body of this function so that we can expand - it inline somewhere else. This means not lowering some constructs - such as exception handling. */ - if (cgraph_preserve_function_body_p (fndecl)) - { - if (!flag_unit_at_a_time) - { - struct cgraph_edge *e; - - saved_node = cgraph_clone_node (node, node->count, 1, false); - for (e = saved_node->callees; e; e = e->next_callee) - if (!e->inline_failed) - cgraph_clone_inlined_nodes (e, true, false); - } - cfun->saved_static_chain_decl = cfun->static_chain_decl; - save_body (fndecl, &cfun->saved_args, &cfun->saved_static_chain_decl); - } - if (flag_inline_trees) { struct cgraph_edge *e; @@ -429,40 +416,7 @@ tree_rest_of_compilation (tree fndecl) /* Release the default bitmap obstack. */ bitmap_obstack_release (NULL); - /* Restore original body if still needed. */ - if (cfun->saved_cfg) - { - DECL_ARGUMENTS (fndecl) = cfun->saved_args; - cfun->cfg = cfun->saved_cfg; - cfun->eh = cfun->saved_eh; - DECL_INITIAL (fndecl) = cfun->saved_blocks; - cfun->unexpanded_var_list = cfun->saved_unexpanded_var_list; - cfun->saved_cfg = NULL; - cfun->saved_eh = NULL; - cfun->saved_args = NULL_TREE; - cfun->saved_blocks = NULL_TREE; - cfun->saved_unexpanded_var_list = NULL_TREE; - cfun->static_chain_decl = cfun->saved_static_chain_decl; - cfun->saved_static_chain_decl = NULL; - /* When not in unit-at-a-time mode, we must preserve out of line copy - representing node before inlining. Restore original outgoing edges - using clone we created earlier. */ - if (!flag_unit_at_a_time) - { - struct cgraph_edge *e; - - node = cgraph_node (current_function_decl); - cgraph_node_remove_callees (node); - node->callees = saved_node->callees; - saved_node->callees = NULL; - update_inlined_to_pointers (node, node); - for (e = node->callees; e; e = e->next_callee) - e->caller = node; - cgraph_remove_node (saved_node); - } - } - else - DECL_SAVED_TREE (fndecl) = NULL; + DECL_SAVED_TREE (fndecl) = NULL; cfun = 0; /* If requested, warn about function definitions where the function will |