diff options
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 |