aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-06-20 09:09:27 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-06-20 07:09:27 +0000
commit569b1784fe1523adf8cbe899834a7cb7f7600bfb (patch)
tree913b51a061c1f0c708a012298e04dcb6036dec74 /gcc/lto-cgraph.c
parent88f5cfcd2bdc48b3def09453babc02d2821f9a60 (diff)
downloadgcc-569b1784fe1523adf8cbe899834a7cb7f7600bfb.zip
gcc-569b1784fe1523adf8cbe899834a7cb7f7600bfb.tar.gz
gcc-569b1784fe1523adf8cbe899834a7cb7f7600bfb.tar.bz2
cgraph.h (struct symtab_node): Add field in_init_priority_hash (set_init_priority...
* cgraph.h (struct symtab_node): Add field in_init_priority_hash (set_init_priority, get_init_priority, set_fini_priority, get_fini_priority): New methods. * tree.c (init_priority_for_decl): Remove. (init_ttree): Do not initialize init priority. (decl_init_priority_lookup, decl_fini_priority_lookup): Rewrite. (decl_priority_info): Remove. (decl_init_priority_insert): Rewrite. (decl_fini_priority_insert): Rewrite. * tree.h (tree_priority_map_eq, tree_priority_map_hash, tree_priority_map_marked_p): Remove. * lto-cgraph.c (lto_output_node, input_node): Stream init priorities. * lto-streamer-out.c (hash_tree): Do not hash priorities. * tree-streamer-out.c (pack_ts_decl_with_vis_value_fields): Do not output priorities. (pack_ts_function_decl_value_fields): Likewise. * tree-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Do not input priorities. (unpack_ts_function_decl_value_fields): Likewise. * symtab.c (symbol_priority_map): Declare. (init_priority_hash): Declare. (symtab_unregister_node): Unregister from priority hash, too. (symtab_node::get_init_priority, cgraph_node::get_fini_priority): New methods. (symbol_priority_map_eq, symbol_priority_map_hash): New functions. (symbol_priority_info): New function. (symtab_node::set_init_priority, cgraph_node::set_fini_priority): New methods. * tree-core.h (tree_priority_map): Remove. * lto.c (compare_tree_sccs_1): Do not compare priorities. From-SVN: r211838
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 6c6896c..54942cf 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -557,6 +557,10 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
streamer_write_uhwi_stream (ob->main_stream, node->thunk.virtual_value);
}
streamer_write_hwi_stream (ob->main_stream, node->profile_id);
+ if (DECL_STATIC_CONSTRUCTOR (node->decl))
+ streamer_write_hwi_stream (ob->main_stream, DECL_INIT_PRIORITY (node->decl));
+ if (DECL_STATIC_DESTRUCTOR (node->decl))
+ streamer_write_hwi_stream (ob->main_stream, DECL_FINI_PRIORITY (node->decl));
}
/* Output the varpool NODE to OB.
@@ -1210,6 +1214,10 @@ input_node (struct lto_file_decl_data *file_data,
if (node->alias && !node->analyzed && node->weakref)
node->alias_target = get_alias_symbol (node->decl);
node->profile_id = streamer_read_hwi (ib);
+ if (DECL_STATIC_CONSTRUCTOR (node->decl))
+ SET_DECL_INIT_PRIORITY (node->decl, streamer_read_hwi (ib));
+ if (DECL_STATIC_DESTRUCTOR (node->decl))
+ SET_DECL_FINI_PRIORITY (node->decl, streamer_read_hwi (ib));
return node;
}