diff options
author | Diego Novillo <dnovillo@google.com> | 2011-06-06 12:49:11 -0400 |
---|---|---|
committer | Diego Novillo <dnovillo@gcc.gnu.org> | 2011-06-06 12:49:11 -0400 |
commit | 47c79d563b4e5d80a48f0c0c870c9025b9d095b4 (patch) | |
tree | 833ac0df274e1c8def946237e10bd907c5de11ee /gcc/lto | |
parent | 7aca3d94becc5827df345447c94b128fd0c45cf8 (diff) | |
download | gcc-47c79d563b4e5d80a48f0c0c870c9025b9d095b4.zip gcc-47c79d563b4e5d80a48f0c0c870c9025b9d095b4.tar.gz gcc-47c79d563b4e5d80a48f0c0c870c9025b9d095b4.tar.bz2 |
Makefile.in (lto-compress.o): Add dependency on LTO_STREAMER_H.
* 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.
From-SVN: r174709
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto.c | 20 |
2 files changed, 22 insertions, 3 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index b247dbb..e8393c1 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2011-06-04 Diego Novillo <dnovillo@google.com> + + * lto.c (lto_init): New. + (lto_main): Call it. + 2011-06-03 Diego Novillo <dnovillo@google.com> * lto.c (get_resolution): Move from lto-streamer-in.c. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 70d5bde..74dfecd 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. */ |