summaryrefslogtreecommitdiff
path: root/gcc/ipa-reference.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-11 03:04:35 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-11 03:04:35 +0000
commit70225339fc4e163f336e06ce11e3460caf57a8d6 (patch)
tree9ecc46e97e1f006538b5fc2f9be799708d6b205c /gcc/ipa-reference.c
parente5bf9f49b6d5c55779d26e8f840465ee70152ed5 (diff)
downloadgcc-70225339fc4e163f336e06ce11e3460caf57a8d6.tar.gz
* cgraph.h (vector types for symtab_node): Add.
* ipa-reference.c (ipa_reference_write_optimization_summary): Update for new symtab encoder. (ipa_reference_read_optimization_summary): Likewise. * lto-cgraph.c (output_varpool): Remove. (input_cgraph_opt_summary): Take symtab nodes vector as argument. (LTO_cgraph_tags): Rename to ... (LTO_symtab_tags): ... this one; add LTO_symtab_variable. (lto_cgraph_encoder_new): Rename to ... (lto_symtab_encoder_new): ... this on. (lto_cgraph_encoder_encode): Rename to ... (lto_symtab_encoder_encode): ... this one. (lto_cgraph_encoder_delete): Rename to ... (lto_symtab_encoder_delete): ... this one. (lto_cgraph_encoder_deref): Rename to ... (lto_symtab_encoder_deref): ... this one. (lto_cgraph_encoder_encode_body_p): Rename to ... (lto_symtab_encoder_encode_body_p): ... this one. (lto_varpool_encoder_new, lto_varpool_encoder_delete, lto_varpool_encoder_encode, lto_varpool_encoder_lookup, lto_varpool_encoder_deref): Remove. (lto_varpool_encoder_encode_initializer_p): Rename to ... (lto_symtab_encoder_encode_initializer_p): ... this one. (lto_set_varpool_encoder_encode_initializer): Rename to ... (lto_set_symtab_encoder_encode_initializer): ... this one. (lto_output_edge): Update. (lto_output_node): Update. (lto_output_varpool_node): Update; stream out LTO_symtab_variable tag. (lto_output_ref): Drop varpool_encoder; update. (add_node_to): Update. (add_references): Update. (output_outgoing_cgraph_edges): Update. (output_refs): Update. (compute_ltrans_boundary): Update. (output_cgraph): Update; output varpools too. (input_overwrite_node): Update. (output_varpool): Remove. (input_node): Update. (input_ref): Update. (input_edge): Update. (input_cgraph_1): Update; input varpool too; unify fixup code. (input_varpool_1): Remove. (input_refs): Update. (input_cgraph): Update. (output_node_opt_summary): Update. (input_cgraph_opt_section): Update. (input_cgraph_opt_summary): Update. * ipa-pure-const.c (pure_const_write_summary): Update. (pure_const_read_summary): Update. * lto-streamer-out.c (lto_write_tree): Update. (lto_output): Likewise. (produce_symtab): Update. (produce_asm_for_decls): Update. * ipa-inline-analysis.c (inline_read_section): Update. (inline_write_summary): Update. * ipa-prop.c (ipa_write_node_info): Update. (ipa_prop_read_section): Update. * lto-streamer.h (lto_cgraph_encoder_d): Rename to ... (lto_symtab_encoder_d): ... this one; add initializer. (lto_cgraph_encoder_t): Rename to ... (lto_symtab_encoder_t): ... this one. (lto_cgraph_encoder_size): Rename to ... (lto_symtab_encoder_size): ... this one. (lto_varpool_encoder_d): ... remove. (lto_varpool_encoder_t): Remove. (lto_out_decl_state): Remove cgraph_node_encoder, varpool_node_encoder add symtab_node_encoder. (lto_file_decl_data): Likewise. (lto_cgraph_encoder_deref, lto_cgraph_encoder_lookup, lto_cgraph_encoder_new, lto_cgraph_encoder_encode, lto_cgraph_encoder_delete, lto_cgraph_encoder_encode_body_p, lto_varpool_encoder_encode_body_p, lto_varpool_encoder_deref, lto_varpool_encoder_lookup, lto_varpool_encoder_new, lto_varpool_encoder_encode, lto_varpool_encoder_delete, lto_varpool_encoder_encode_initializer_p): Remove. (lto_symtab_encoder_deref, lto_symtab_encoder_lookup, lto_symtab_encoder_t, lto_symtab_encoder_encode, lto_symtab_encoder_delete, lto_symtab_encoder_encode_body_p, lto_symtab_encoder_encode_initializer_p): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190309 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-reference.c')
-rw-r--r--gcc/ipa-reference.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index 732f49d7104..371148dbc30 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -1029,21 +1029,25 @@ ipa_reference_write_optimization_summary (cgraph_node_set set,
varpool_node_set vset)
{
struct cgraph_node *node;
+ symtab_node snode;
struct lto_simple_output_block *ob
= lto_create_simple_output_block (LTO_section_ipa_reference);
unsigned int count = 0;
int ltrans_statics_bitcount = 0;
- lto_cgraph_encoder_t encoder = ob->decl_state->cgraph_node_encoder;
- lto_varpool_encoder_t varpool_encoder = ob->decl_state->varpool_node_encoder;
+ lto_symtab_encoder_t encoder = ob->decl_state->symtab_node_encoder;
bitmap ltrans_statics = BITMAP_ALLOC (NULL);
int i;
reference_vars_to_consider = splay_tree_new (splay_tree_compare_ints, 0, 0);
/* See what variables we are interested in. */
- for (i = 0; i < lto_varpool_encoder_size (varpool_encoder); i++)
+ for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
{
- struct varpool_node *vnode = lto_varpool_encoder_deref (varpool_encoder, i);
+ struct varpool_node *vnode;
+ snode = lto_symtab_encoder_deref (encoder, i);
+ if (!symtab_variable_p (snode))
+ continue;
+ vnode = varpool (snode);
if (bitmap_bit_p (all_module_statics, DECL_UID (vnode->symbol.decl))
&& referenced_from_this_partition_p (&vnode->symbol.ref_list, set, vset))
{
@@ -1057,8 +1061,9 @@ ipa_reference_write_optimization_summary (cgraph_node_set set,
if (ltrans_statics_bitcount)
- for (i = 0; i < lto_cgraph_encoder_size (encoder); i++)
- if (write_node_summary_p (lto_cgraph_encoder_deref (encoder, i),
+ for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
+ if (symtab_function_p (snode = lto_symtab_encoder_deref (encoder, i))
+ && write_node_summary_p (cgraph (snode),
set, vset, ltrans_statics))
count++;
@@ -1069,16 +1074,19 @@ ipa_reference_write_optimization_summary (cgraph_node_set set,
/* Process all of the functions. */
if (ltrans_statics_bitcount)
- for (i = 0; i < lto_cgraph_encoder_size (encoder); i++)
+ for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
{
- node = lto_cgraph_encoder_deref (encoder, i);
+ snode = lto_symtab_encoder_deref (encoder, i);
+ if (!symtab_function_p (snode))
+ continue;
+ node = cgraph (snode);
if (write_node_summary_p (node, set, vset, ltrans_statics))
{
ipa_reference_optimization_summary_t info;
int node_ref;
info = get_reference_optimization_summary (node);
- node_ref = lto_cgraph_encoder_encode (encoder, node);
+ node_ref = lto_symtab_encoder_encode (encoder, (symtab_node) node);
streamer_write_uhwi_stream (ob->main_stream, node_ref);
stream_out_bitmap (ob, info->statics_not_read, ltrans_statics,
@@ -1144,11 +1152,11 @@ ipa_reference_read_optimization_summary (void)
struct cgraph_node *node;
ipa_reference_optimization_summary_t info;
int v_count;
- lto_cgraph_encoder_t encoder;
+ lto_symtab_encoder_t encoder;
index = streamer_read_uhwi (ib);
- encoder = file_data->cgraph_node_encoder;
- node = lto_cgraph_encoder_deref (encoder, index);
+ encoder = file_data->symtab_node_encoder;
+ node = cgraph (lto_symtab_encoder_deref (encoder, index));
info = XCNEW (struct ipa_reference_optimization_summary_d);
set_reference_optimization_summary (node, info);
info->statics_not_read = BITMAP_ALLOC (&optimization_summary_obstack);