diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-04 09:46:56 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-04 09:46:56 +0000 |
commit | f1007c727dc9c36237a88d488c6a02b2907eb7f4 (patch) | |
tree | 57ee07886936e8cdf54731ec7b22e1981530e307 /gcc/lto-cgraph.c | |
parent | 68a79dfc3e3ff556af61cf871d589a7dc8efc374 (diff) | |
download | gcc-f1007c727dc9c36237a88d488c6a02b2907eb7f4.tar.gz |
* lto-streamer.h (lto_input_toplevel_asms): Add order_base parameter.
* lto-streamer-in.c (lto_input_toplevel_asms): Stream in order.
* lto-streamer-out.c (lto_output_toplevel_asms): Stream out order.
* lto-cgraph.c (order_base): New static var.
(lto_output_node): Stream in order.
(lto_output_varpool_node): Stream out order.
(input_node): Stream in order.
(input_varpool_node): Stream out order.
(input_cgraph_1): Initialize order base; update call of
lto_input_toplevel_asms.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179496 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r-- | gcc/lto-cgraph.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 9254b8f9014..833bf84743b 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -54,6 +54,9 @@ static void input_cgraph_opt_summary (VEC (cgraph_node_ptr, heap) * nodes); /* Number of LDPR values known to GCC. */ #define LDPR_NUM_KNOWN (LDPR_PREVAILING_DEF_IRONLY_EXP + 1) +/* All node orders are ofsetted by ORDER_BASE. */ +static int order_base; + /* Cgraph streaming is organized as set of record whose type is indicated by a tag. */ enum LTO_cgraph_tags @@ -425,6 +428,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, streamer_write_enum (ob->main_stream, LTO_cgraph_tags, LTO_cgraph_last_tag, tag); + streamer_write_hwi_stream (ob->main_stream, node->order); /* In WPA mode, we only output part of the call-graph. Also, we fake cgraph node attributes. There are two cases that we care. @@ -548,6 +552,7 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node struct bitpack_d bp; int ref; + streamer_write_hwi_stream (ob->main_stream, node->order); lto_output_var_decl_index (ob->decl_state, ob->main_stream, node->decl); bp = bitpack_create (ob->main_stream); bp_pack_value (&bp, node->externally_visible, 1); @@ -960,7 +965,9 @@ input_node (struct lto_file_decl_data *file_data, unsigned decl_index; int ref = LCC_NOT_FOUND, ref2 = LCC_NOT_FOUND; int clone_ref; + int order; + order = streamer_read_hwi (ib) + order_base; clone_ref = streamer_read_hwi (ib); decl_index = streamer_read_uhwi (ib); @@ -974,6 +981,10 @@ input_node (struct lto_file_decl_data *file_data, else node = cgraph_get_create_node (fn_decl); + node->order = order; + if (order >= cgraph_order) + cgraph_order = order + 1; + node->count = streamer_read_hwi (ib); node->count_materialization_scale = streamer_read_hwi (ib); @@ -1035,10 +1046,15 @@ input_varpool_node (struct lto_file_decl_data *file_data, struct bitpack_d bp; int ref = LCC_NOT_FOUND; bool non_null_aliasof; + int order; + order = streamer_read_hwi (ib) + order_base; decl_index = streamer_read_uhwi (ib); var_decl = lto_file_decl_data_get_var_decl (file_data, decl_index); node = varpool_node (var_decl); + node->order = order; + if (order >= cgraph_order) + cgraph_order = order + 1; node->lto_file_data = file_data; bp = streamer_read_bitpack (ib); @@ -1178,6 +1194,7 @@ input_cgraph_1 (struct lto_file_decl_data *file_data, unsigned i; tag = streamer_read_enum (ib, LTO_cgraph_tags, LTO_cgraph_last_tag); + order_base = cgraph_order; while (tag) { if (tag == LTO_cgraph_edge) @@ -1196,7 +1213,7 @@ input_cgraph_1 (struct lto_file_decl_data *file_data, tag = streamer_read_enum (ib, LTO_cgraph_tags, LTO_cgraph_last_tag); } - lto_input_toplevel_asms (file_data); + lto_input_toplevel_asms (file_data, order_base); /* AUX pointers should be all non-zero for nodes read from the stream. */ #ifdef ENABLE_CHECKING |