OSDN Git Service

2011-09-02 Robert Dewar <dewar@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / lto-section-out.c
index 55c9d8d..fe3cc54 100644 (file)
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "pointer-set.h"
 #include "bitmap.h"
 #include "langhooks.h"
+#include "data-streamer.h"
 #include "lto-streamer.h"
 #include "lto-compress.h"
 
@@ -265,113 +266,6 @@ lto_output_data_stream (struct lto_output_stream *obs, const void *data,
 }
 
 
-/* Output an unsigned LEB128 quantity to OBS.  */
-
-void
-lto_output_uleb128_stream (struct lto_output_stream *obs,
-                          unsigned HOST_WIDE_INT work)
-{
-  do
-    {
-      unsigned int byte = (work & 0x7f);
-      work >>= 7;
-      if (work != 0)
-       /* More bytes to follow.  */
-       byte |= 0x80;
-
-      lto_output_1_stream (obs, byte);
-    }
-  while (work != 0);
-}
-
-/* Identical to output_uleb128_stream above except using unsigned
-   HOST_WIDEST_INT type.  For efficiency on host where unsigned HOST_WIDEST_INT
-   is not native, we only use this if we know that HOST_WIDE_INT is not wide
-   enough.  */
-
-void
-lto_output_widest_uint_uleb128_stream (struct lto_output_stream *obs,
-                                      unsigned HOST_WIDEST_INT work)
-{
-  do
-    {
-      unsigned int byte = (work & 0x7f);
-      work >>= 7;
-      if (work != 0)
-       /* More bytes to follow.  */
-       byte |= 0x80;
-
-      lto_output_1_stream (obs, byte);
-    }
-  while (work != 0);
-}
-
-
-/* Output a signed LEB128 quantity.  */
-
-void
-lto_output_sleb128_stream (struct lto_output_stream *obs, HOST_WIDE_INT work)
-{
-  int more, byte;
-
-  do
-    {
-      byte = (work & 0x7f);
-      /* arithmetic shift */
-      work >>= 7;
-      more = !((work == 0 && (byte & 0x40) == 0)
-              || (work == -1 && (byte & 0x40) != 0));
-      if (more)
-       byte |= 0x80;
-
-      lto_output_1_stream (obs, byte);
-    }
-  while (more);
-}
-
-
-/* Pack WORK into BP in a variant of uleb format.  */
-
-void
-bp_pack_var_len_unsigned (struct bitpack_d *bp, unsigned HOST_WIDE_INT work)
-{
-  do
-    {
-      unsigned int half_byte = (work & 0x7);
-      work >>= 3;
-      if (work != 0)
-       /* More half_bytes to follow.  */
-       half_byte |= 0x8;
-
-      bp_pack_value (bp, half_byte, 4);
-    }
-  while (work != 0);
-}
-
-
-/* Pack WORK into BP in a variant of sleb format.  */
-
-void
-bp_pack_var_len_int (struct bitpack_d *bp, HOST_WIDE_INT work)
-{
-  int more, half_byte;
-
-  do
-    {
-      half_byte = (work & 0x7);
-      /* arithmetic shift */
-      work >>= 3;
-      more = !((work == 0 && (half_byte & 0x4) == 0)
-              || (work == -1 && (half_byte & 0x4) != 0));
-      if (more)
-       half_byte |= 0x8;
-
-      bp_pack_value (bp, half_byte, 4);
-    }
-  while (more);
-}
-
-
 /* Lookup NAME in ENCODER.  If NAME is not found, create a new entry in
    ENCODER for NAME with the next available index of ENCODER,  then
    print the index to OBS.  True is returned if NAME was added to
@@ -410,7 +304,7 @@ lto_output_decl_index (struct lto_output_stream *obs,
     }
 
   if (obs)
-    lto_output_uleb128_stream (obs, index);
+    streamer_write_uhwi_stream (obs, index);
   *this_index = index;
   return new_entry_p;
 }