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/tree-streamer-out.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'gcc/tree-streamer-out.c') diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index 093b4b3..58be0a3 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -31,14 +31,15 @@ along with GCC; see the file COPYING3. If not see /* Output the STRING constant to the string table in OB. Then put the index onto the INDEX_STREAM. */ -static void -write_string_cst (struct output_block *ob, - struct lto_output_stream *index_stream, - tree string) +void +streamer_write_string_cst (struct output_block *ob, + struct lto_output_stream *index_stream, + tree string) { streamer_write_string_with_length (ob, index_stream, - TREE_STRING_POINTER (string), - TREE_STRING_LENGTH (string), + string ? TREE_STRING_POINTER (string) + : NULL, + string ? TREE_STRING_LENGTH (string) : 0, true); } @@ -866,7 +867,7 @@ streamer_write_tree_header (struct output_block *ob, tree expr) /* The text in strings and identifiers are completely emitted in the header. */ if (CODE_CONTAINS_STRUCT (code, TS_STRING)) - write_string_cst (ob, ob->main_stream, expr); + streamer_write_string_cst (ob, ob->main_stream, expr); else if (CODE_CONTAINS_STRUCT (code, TS_IDENTIFIER)) write_identifier (ob, ob->main_stream, expr); else if (CODE_CONTAINS_STRUCT (code, TS_VEC)) -- cgit v1.1