diff options
author | Richard Biener <rguenther@suse.de> | 2012-10-15 14:22:37 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-10-15 14:22:37 +0000 |
commit | 8135e1e691f50e1abb33f6ed602679692b322016 (patch) | |
tree | 29792e758bcfc639546baec2d11f930c80e0612b /gcc/data-streamer-out.c | |
parent | 1183dc2cd8631233db425d7310fd930f335bfeee (diff) | |
download | gcc-8135e1e691f50e1abb33f6ed602679692b322016.tar.gz |
data-streamer.h (bp_pack_string_with_length): New function.
2012-10-15 Richard Biener <rguenther@suse.de>
* data-streamer.h (bp_pack_string_with_length): New function.
(bp_pack_string): Likewise.
(bp_unpack_indexed_string): Likewise.
(bp_unpack_string): Likewise.
* data-streamer-out.c (bp_pack_string_with_length): Likewise.
(bp_pack_string): Likewise.
* data-streamer-in.c (bp_unpack_indexed_string): Likewise.
(bp_unpack_string): Likewise.
* tree-streamer-out.c (pack_ts_translation_unit_decl_value_fields):
Pack TRANSLATION_UNIT_LANGUAGE here, not ...
(write_ts_translation_unit_decl_tree_pointers): ... here. Remove.
(streamer_pack_tree_bitfields): Adjust.
(streamer_write_tree_body): Likewise.
* tree-streamer-in.c (unpack_ts_translation_unit_decl_value_fields):
Unpack TRANSLATION_UNIT_LANGUAGE here, not ...
(lto_input_ts_translation_unit_decl_tree_pointers): ... here. Remove.
(unpack_value_fields): Adjust.
(streamer_read_tree_body): Likewise.
From-SVN: r192460
Diffstat (limited to 'gcc/data-streamer-out.c')
-rw-r--r-- | gcc/data-streamer-out.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/data-streamer-out.c b/gcc/data-streamer-out.c index 98cbf226176..aae4d471fb6 100644 --- a/gcc/data-streamer-out.c +++ b/gcc/data-streamer-out.c @@ -115,6 +115,39 @@ streamer_write_string (struct output_block *ob, } +/* Output STRING of LEN characters to the string table in OB. Then + put the index into BP. + When PERSISTENT is set, the string S is supposed to not change during + duration of the OB and thus OB can keep pointer into it. */ + +void +bp_pack_string_with_length (struct output_block *ob, struct bitpack_d *bp, + const char *s, unsigned int len, bool persistent) +{ + unsigned index = 0; + if (s) + index = streamer_string_index (ob, s, len, persistent); + bp_pack_var_len_unsigned (bp, index); +} + + +/* Output the '\0' terminated STRING to the string + table in OB. Then put the index onto the bitpack BP. + When PERSISTENT is set, the string S is supposed to not change during + duration of the OB and thus OB can keep pointer into it. */ + +void +bp_pack_string (struct output_block *ob, struct bitpack_d *bp, + const char *s, bool persistent) +{ + unsigned index = 0; + if (s) + index = streamer_string_index (ob, s, strlen (s) + 1, persistent); + bp_pack_var_len_unsigned (bp, index); +} + + + /* Write a zero to the output stream. */ void |