From a0605d65f057d09d208c6175c8ef78b8809184da Mon Sep 17 00:00:00 2001 From: dnovillo Date: Mon, 6 Jun 2011 16:49:11 +0000 Subject: * Makefile.in (lto-compress.o): Add dependency on LTO_STREAMER_H. (cgraph.o): Likewise. (cgraphunit.o): Likewise. * cgraphunit.c: Include lto-streamer.h (cgraph_finalize_compilation_unit): Call lto_streamer_hooks_init if LTO is enabled. * lto-streamer-in.c (unpack_value_fields): Call streamer_hooks.unpack_value_fields if set. (lto_materialize_tree): For unhandled nodes, first try to call lto_streamer_hooks.alloc_tree, if it exists. (lto_input_ts_decl_common_tree_pointers): Move reading of DECL_INITIAL to lto_streamer_read_tree. (lto_read_tree): Call lto_streamer_hooks.read_tree if set. (lto_streamer_read_tree): New. (lto_reader_init): Rename from lto_init_reader. Move initialization code to lto/lto.c. * lto-streamer-out.c (pack_value_fields): Call streamer_hooks.pack_value_fields if set. (lto_output_tree_ref): For tree nodes that are not normally indexable, call streamer_hooks.indexable_with_decls_p before giving up. (lto_output_ts_decl_common_tree_pointers): Move handling for FUNCTION_DECL and TRANSLATION_UNIT_DECL to lto_streamer_write_tree. (lto_output_tree_header): Call streamer_hooks.is_streamable instead of lto_is_streamable. Call lto_streamer_hooks.output_tree_header if set. (lto_write_tree): Call lto_streamer_hooks.write_tree if set. (lto_streamer_write_tree): New. (lto_output): Call lto_streamer_init directly. (lto_writer_init): Remove. * lto-streamer.c (streamer_hooks): New. (lto_streamer_cache_create): Call streamer_hooks.preload_common_nodes instead of lto_preload_common_nodes. (lto_is_streamable): Move from lto-streamer.h (lto_streamer_hooks_init): New. (streamer_hooks): New. (streamer_hooks_init): New. * lto-streamer.h (struct output_block): Forward declare. (struct lto_input_block): Likewise. (struct data_in): Likewise. (struct bitpack_d): Likewise. (struct streamer_hooks): Declare. (streamer_hooks): Declare. (lto_streamer_hooks_init): Declare. (lto_streamer_write_tree): Declare. (lto_streamer_read_tree): Declare. (streamer_hooks_init): Declare. (lto_is_streamable): Move to lto-streamer.c lto/ChangeLog * lto.c (lto_init): New. (lto_main): Call it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174709 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/lto/ChangeLog | 5 +++++ gcc/lto/lto.c | 20 +++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'gcc/lto') diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index b247dbbdd07..e8393c1f523 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2011-06-04 Diego Novillo + + * lto.c (lto_init): New. + (lto_main): Call it. + 2011-06-03 Diego Novillo * lto.c (get_resolution): Move from lto-streamer-in.c. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 70d5bdee458..74dfecdbc3e 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -2732,6 +2732,21 @@ lto_process_name (void) setproctitle ("lto1-ltrans"); } + +/* Initialize the LTO front end. */ + +static void +lto_init (void) +{ + lto_process_name (); + lto_streamer_hooks_init (); + lto_reader_init (); + memset (<o_stats, 0, sizeof (lto_stats)); + bitmap_obstack_initialize (NULL); + gimple_register_cfg_hooks (); +} + + /* Main entry point for the GIMPLE front end. This front end has three main personalities: @@ -2755,9 +2770,8 @@ lto_process_name (void) void lto_main (void) { - lto_process_name (); - - lto_init_reader (); + /* Initialize the LTO front end. */ + lto_init (); /* Read all the symbols and call graph from all the files in the command line. */ -- cgit v1.2.1