/* Routines for saving various data types to a file stream. This deals
with various data types like strings, integers, enums, etc.
- Copyright (C) 2011-2015 Free Software Foundation, Inc.
+ Copyright (C) 2011-2017 Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@google.com>
This file is part of GCC.
void
streamer_write_gcov_count_stream (struct lto_output_stream *obs, gcov_type work)
{
- gcc_assert (work >= 0);
gcc_assert ((HOST_WIDE_INT) work == work);
streamer_write_hwi_stream (obs, work);
}
}
}
+/* Emit the physical representation of wide_int VAL to output block OB. */
+
+void
+streamer_write_wide_int (struct output_block *ob, const wide_int &val)
+{
+ int len = val.get_len ();
+
+ streamer_write_uhwi (ob, val.get_precision ());
+ streamer_write_uhwi (ob, len);
+ for (int i = 0; i < len; i++)
+ streamer_write_hwi (ob, val.elt (i));
+}
+
+/* Emit the physical representation of widest_int W to output block OB. */
+
+void
+streamer_write_widest_int (struct output_block *ob,
+ const widest_int &w)
+{
+ int len = w.get_len ();
+
+ streamer_write_uhwi (ob, w.get_precision ());
+ streamer_write_uhwi (ob, len);
+ for (int i = 0; i < len; i++)
+ streamer_write_hwi (ob, w.elt (i));
+}
+