From 49f836ba6fdf80354f675af50837fbdb7144e081 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 30 Sep 2011 14:56:01 +0000 Subject: Split out LTO's writing of top level asm nodes in preparation of extending what... 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 * 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. From-SVN: r179386 --- gcc/lto-streamer.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'gcc/lto-streamer.h') diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 2564bd2ec21..ee818429328 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -142,7 +142,7 @@ along with GCC; see the file COPYING3. If not see #define LTO_SECTION_NAME_PREFIX ".gnu.lto_" #define LTO_major_version 2 -#define LTO_minor_version 0 +#define LTO_minor_version 1 typedef unsigned char lto_decl_flags_t; @@ -238,6 +238,7 @@ enum lto_section_type LTO_section_cgraph, LTO_section_varpool, LTO_section_refs, + LTO_section_asm, LTO_section_jump_functions, LTO_section_ipa_pure_const, LTO_section_ipa_reference, @@ -387,6 +388,23 @@ struct lto_decl_header }; +/* Structure describing top level asm()s. */ +struct lto_asm_header +{ + /* The header for all types of sections. */ + struct lto_header lto_header; + + /* Size compressed or 0 if not compressed. */ + int32_t compressed_size; + + /* Size of region for expressions, decls, types, etc. */ + int32_t main_size; + + /* Size of the string table. */ + int32_t string_size; +}; + + /* Statistics gathered during LTO, WPA and LTRANS. */ struct lto_stats_d { @@ -789,6 +807,7 @@ extern void lto_input_function_body (struct lto_file_decl_data *, tree, const char *); extern void lto_input_constructors_and_inits (struct lto_file_decl_data *, const char *); +extern void lto_input_toplevel_asms (struct lto_file_decl_data *); extern struct data_in *lto_data_in_create (struct lto_file_decl_data *, const char *, unsigned, VEC(ld_plugin_symbol_resolution_t,heap) *); @@ -807,6 +826,7 @@ extern void lto_register_decl_definition (tree, struct lto_file_decl_data *); extern struct output_block *create_output_block (enum lto_section_type); extern void destroy_output_block (struct output_block *); extern void lto_output_tree (struct output_block *, tree, bool); +extern void lto_output_toplevel_asms (void); extern void produce_asm (struct output_block *ob, tree fn); void lto_output_decl_state_streams (struct output_block *, struct lto_out_decl_state *); -- cgit v1.2.1