summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-in.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-03 19:54:18 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-03 19:54:18 +0000
commit4df870fdeec85907db3dcabf1992cf8b63e1d562 (patch)
tree03ce7f28fa403515aaa2237e480f2c85c5013a0b /gcc/lto-streamer-in.c
parentdda4f0ece17a96da6fbeddab8326ccd502171fa1 (diff)
downloadgcc-4df870fdeec85907db3dcabf1992cf8b63e1d562.tar.gz
* lto-cgraph.c (compute_ltrans_boundary): Add abstract origins into
boundaries. * lto-streamer-out.c (tree_is_indexable): Results decls and parm decls are not indexable. (DFS_write_tree_body): Do not follow args and results. (hash_tree): Likewise. (output_functions): Rearrange so struct function is needed only when real body is output; be able to also ouptut abstract functions; output DECL_ARGUMENTS and DECL_RESULT. (lto_output): When not in WPA, ale store abstract functions. (write_symbol): Do not care about RESULT_DECL. (output_symbol_p): Handle correctly sbtract decls. * lto-streamer-in.c (input_function): Rearrange so struct function can be NULL at entry; allow streaming of functions w/o body; store DECL_ARGUMENTS and DECL_RESULT. * ipa.c (symtab_remove_unreachable_nodes): Silence confused sanity check during LTO. * tree-streamer-out.c (write_ts_decl_non_common_tree_pointers): Skip RESULT_DECl and DECL_ARGUMENTS. * tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers): Likewise. * lto.c (lto_materialize_function): Do not push struct function. * lto-partition.c (get_symbol_class): Handle abstracts correctly. (may_need_named_section_p): Even abstract origins may need named section. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201468 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r--gcc/lto-streamer-in.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index fe7ab7c5067..70a87d1738b 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -851,7 +851,7 @@ input_struct_function_base (struct function *fn, struct data_in *data_in,
static void
input_function (tree fn_decl, struct data_in *data_in,
- struct lto_input_block *ib)
+ struct lto_input_block *ib, struct lto_input_block *ib_cfg)
{
struct function *fn;
enum LTO_tags tag;
@@ -859,13 +859,30 @@ input_function (tree fn_decl, struct data_in *data_in,
basic_block bb;
struct cgraph_node *node;
- fn = DECL_STRUCT_FUNCTION (fn_decl);
tag = streamer_read_record_start (ib);
+ lto_tag_check (tag, LTO_function);
+
+ /* Read decls for parameters and args. */
+ DECL_RESULT (fn_decl) = stream_read_tree (ib, data_in);
+ DECL_ARGUMENTS (fn_decl) = streamer_read_chain (ib, data_in);
+
+ /* Read the tree of lexical scopes for the function. */
+ DECL_INITIAL (fn_decl) = stream_read_tree (ib, data_in);
+
+ if (!streamer_read_uhwi (ib))
+ return;
+
+ push_struct_function (fn_decl);
+ fn = DECL_STRUCT_FUNCTION (fn_decl);
+ init_tree_ssa (fn);
+ /* We input IL in SSA form. */
+ cfun->gimple_df->in_ssa_p = true;
gimple_register_cfg_hooks ();
- lto_tag_check (tag, LTO_function);
+ node = cgraph_get_create_node (fn_decl);
input_struct_function_base (fn, data_in, ib);
+ input_cfg (ib_cfg, fn, node->count_materialization_scale);
/* Read all the SSA names. */
input_ssa_names (ib, data_in, fn);
@@ -873,11 +890,8 @@ input_function (tree fn_decl, struct data_in *data_in,
/* Read the exception handling regions in the function. */
input_eh_regions (ib, data_in, fn);
- /* Read the tree of lexical scopes for the function. */
- DECL_INITIAL (fn_decl) = stream_read_tree (ib, data_in);
gcc_assert (DECL_INITIAL (fn_decl));
DECL_SAVED_TREE (fn_decl) = NULL_TREE;
- node = cgraph_get_create_node (fn_decl);
/* Read all the basic blocks. */
tag = streamer_read_record_start (ib);
@@ -987,28 +1001,21 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
if (section_type == LTO_section_function_body)
{
- struct function *fn = DECL_STRUCT_FUNCTION (fn_decl);
struct lto_in_decl_state *decl_state;
struct cgraph_node *node = cgraph_get_node (fn_decl);
unsigned from;
gcc_checking_assert (node);
- push_cfun (fn);
- init_tree_ssa (fn);
-
- /* We input IL in SSA form. */
- cfun->gimple_df->in_ssa_p = true;
/* Use the function's decl state. */
decl_state = lto_get_function_in_decl_state (file_data, fn_decl);
gcc_assert (decl_state);
file_data->current_decl_state = decl_state;
- input_cfg (&ib_cfg, fn, node->count_materialization_scale);
/* Set up the struct function. */
from = data_in->reader_cache->nodes.length ();
- input_function (fn_decl, data_in, &ib_main);
+ input_function (fn_decl, data_in, &ib_main, &ib_cfg);
/* And fixup types we streamed locally. */
{
struct streamer_tree_cache_d *cache = data_in->reader_cache;