diff options
author | Jan Beulich <jbeulich@suse.com> | 2011-09-30 14:56:01 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2011-09-30 14:56:01 +0000 |
commit | 351fbb239d6ea0ba067ac713b6796bf88e42b3e3 (patch) | |
tree | 088e41e292b4cc3059b11b7ac23f10733b2a3912 /gcc/lto-streamer-in.c | |
parent | 3aea2667424e3f632a25d4c3a9e153312931f411 (diff) |
Split out LTO's writing of top level asm nodes in preparation of extending
what needs to be written out when top level asm-s get enhanced to accept a
limited set of input operands.
gcc/
2011-09-30 Jan Beulich <jbeulich@suse.com>
* lto-cgraph.c (output_cgraph): Remove processing of
'cgraph_asm_nodes', call lto_output_toplevel_asms() instead.
(input_cgraph_1): Remove loop calling cgraph_add_asm_node(), call
lto_input_toplevel_asms() instead.
* lto-section-in.c (lto_section_name): Add "asm" entry.
* lto-streamer-in.c (lto_input_toplevel_asms): New.
* lto-streamer-out.c (lto_output_toplevel_asms): New.
* lto-streamer.h (LTO_minor_version): Bump.
(enum lto_section_type): Add LTO_section_asm.
(struct lto_asm_header): New.
(lto_input_toplevel_asms, lto_output_toplevel_asms): Declare.
* tree-streamer.h (streamer_write_string_cst): Declare.
* tree-streamer-out.c (write_string_cst): Rename to
streamer_write_string_cst and make global. Handle incoming string
being NULL.
(streamer_write_tree_header): Adjust call to renamed function.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@179386 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r-- | gcc/lto-streamer-in.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index bae21d5bc4a..ef972cab1d0 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -1141,6 +1141,47 @@ lto_input_tree (struct lto_input_block *ib, struct data_in *data_in) } +/* Input toplevel asms. */ + +void +lto_input_toplevel_asms (struct lto_file_decl_data *file_data) +{ + size_t len; + const char *data = lto_get_section_data (file_data, LTO_section_asm, + NULL, &len); + const struct lto_asm_header *header = (const struct lto_asm_header *) data; + int32_t string_offset; + struct data_in *data_in; + struct lto_input_block ib; + tree str; + + if (! data) + return; + + string_offset = sizeof (*header) + header->main_size; + + LTO_INIT_INPUT_BLOCK (ib, + data + sizeof (*header), + 0, + header->main_size); + + data_in = lto_data_in_create (file_data, data + string_offset, + header->string_size, NULL); + + /* Make sure the file was generated by the exact same compiler. */ + lto_check_version (header->lto_header.major_version, + header->lto_header.minor_version); + + while ((str = streamer_read_string_cst (data_in, &ib))) + cgraph_add_asm_node (str); + + clear_line_info (data_in); + lto_data_in_delete (data_in); + + lto_free_section_data (file_data, LTO_section_asm, NULL, data, len); +} + + /* Initialization for the LTO reader. */ void |