]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
data-streamer.h (streamer_string_index, [...]): Remove.
authorRichard Biener <rguenther@suse.de>
Fri, 15 Aug 2014 07:51:35 +0000 (07:51 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 15 Aug 2014 07:51:35 +0000 (07:51 +0000)
2014-08-15  Richard Biener  <rguenther@suse.de>

* data-streamer.h (streamer_string_index, string_for_index):
Remove.
* data-streamer-out.c (streamer_string_index): Make static.
* data-streamer-in.c (string_for_index): Likewise.
* lto-streamer-out.c (lto_output_location): Use bp_pack_string.
* lto-streamer-in.c (lto_input_location): Use bp_unpack_string.

From-SVN: r214007

gcc/ChangeLog
gcc/data-streamer-in.c
gcc/data-streamer-out.c
gcc/data-streamer.h
gcc/lto-streamer-in.c
gcc/lto-streamer-out.c

index 06b57ff6c0c73c3fbaa7cfb7b2f99905b41af90b..3134daa6f0a83d01981de0e5c9fd8d0ed36ac570 100644 (file)
@@ -1,3 +1,12 @@
+2014-08-15  Richard Biener  <rguenther@suse.de>
+
+       * data-streamer.h (streamer_string_index, string_for_index):
+       Remove.
+       * data-streamer-out.c (streamer_string_index): Make static.
+       * data-streamer-in.c (string_for_index): Likewise.
+       * lto-streamer-out.c (lto_output_location): Use bp_pack_string.
+       * lto-streamer-in.c (lto_input_location): Use bp_unpack_string.
+
 2014-08-15  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/62031
index 6e65cf57841c58ee582e885e14fc3f1eb5bf798d..ea1628c30dcf962b2fddbbebcb024545d0403fca 100644 (file)
@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3.  If not see
 /* Read a string from the string table in DATA_IN using input block
    IB.  Write the length to RLEN.  */
 
-const char *
+static const char *
 string_for_index (struct data_in *data_in, unsigned int loc, unsigned int *rlen)
 {
   unsigned int len;
index 4b3a0119dbe6c850dc18bb0462c171aed20cd62d..4b904767b231fdfa0753326e5b8c26ddf6583af5 100644 (file)
@@ -81,7 +81,7 @@ lto_append_block (struct lto_output_stream *obs)
    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.  */
 
-unsigned
+static unsigned
 streamer_string_index (struct output_block *ob, const char *s, unsigned int len,
                       bool persistent)
 {
index 56fedd2764d67a3ed5b8cde2e58f30e200295eae..eb3709ab550b2f97b743a04cd62018b69281d559 100644 (file)
@@ -57,8 +57,6 @@ void streamer_write_hwi (struct output_block *, HOST_WIDE_INT);
 void streamer_write_gcov_count (struct output_block *, gcov_type);
 void streamer_write_string (struct output_block *, struct lto_output_stream *,
                            const char *, bool);
-unsigned streamer_string_index (struct output_block *, const char *,
-                               unsigned int, bool);
 void streamer_write_string_with_length (struct output_block *,
                                        struct lto_output_stream *,
                                        const char *, unsigned int, bool);
@@ -74,7 +72,6 @@ void streamer_write_data_stream (struct lto_output_stream *, const void *,
                                 size_t);
 
 /* In data-streamer-in.c  */
-const char *string_for_index (struct data_in *, unsigned int, unsigned int *);
 const char *streamer_read_string (struct data_in *, struct lto_input_block *);
 const char *streamer_read_indexed_string (struct data_in *,
                                          struct lto_input_block *,
index 391115778b9089a02e29fa0d4b59af26e1ff071c..f6488d84b2a5071a3199beff9eb6a3dd8a5658af 100644 (file)
@@ -154,7 +154,6 @@ lto_input_location (struct bitpack_d *bp, struct data_in *data_in)
   static int current_line;
   static int current_col;
   bool file_change, line_change, column_change;
-  unsigned len;
   bool prev_file = current_file != NULL;
 
   if (bp_unpack_value (bp, 1))
@@ -165,10 +164,7 @@ lto_input_location (struct bitpack_d *bp, struct data_in *data_in)
   column_change = bp_unpack_value (bp, 1);
 
   if (file_change)
-    current_file = canon_file_name
-                    (string_for_index (data_in,
-                                       bp_unpack_var_len_unsigned (bp),
-                                       &len));
+    current_file = canon_file_name (bp_unpack_string (data_in, bp));
 
   if (line_change)
     current_line = bp_unpack_var_len_unsigned (bp);
index 029b662c5f23767d3552e97aba9e32a2c55430c4..1dc37efc2b89ce77452a14d3189da886a99441f8 100644 (file)
@@ -189,10 +189,7 @@ lto_output_location (struct output_block *ob, struct bitpack_d *bp,
   bp_pack_value (bp, ob->current_col != xloc.column, 1);
 
   if (ob->current_file != xloc.file)
-    bp_pack_var_len_unsigned (bp,
-                             streamer_string_index (ob, xloc.file,
-                                                    strlen (xloc.file) + 1,
-                                                    true));
+    bp_pack_string (ob, bp, xloc.file, true);
   ob->current_file = xloc.file;
 
   if (ob->current_line != xloc.line)