aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-streamer-out.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-10-18 10:59:55 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-10-18 10:59:55 +0000
commitc61f8c3b79e093c3485d1b381a04b482c7edf885 (patch)
treeca0e67dc21d055b07a4151f583dd237d2349044d /gcc/tree-streamer-out.c
parent595fefee5d18e9a08f2e7b1be156be4ace719a6f (diff)
downloadgcc-c61f8c3b79e093c3485d1b381a04b482c7edf885.zip
gcc-c61f8c3b79e093c3485d1b381a04b482c7edf885.tar.gz
gcc-c61f8c3b79e093c3485d1b381a04b482c7edf885.tar.bz2
lto-streamer.h (enum LTO_tags): Add LTO_integer_cst.
2012-10-18 Richard Guenther <rguenther@suse.de> * lto-streamer.h (enum LTO_tags): Add LTO_integer_cst. * lto-streamer-in.c (lto_input_tree): Use it. * lto-streamer-out.c (lto_output_tree): Likewise, for !TREE_OVERFLOW integer constants only. * tree-streamer-in.c (unpack_ts_int_cst_value_fields): New function. (unpack_value_fields): Call it. (streamer_read_integer_cst): Simplify. * tree-streamer-out.c (pack_ts_int_cst_value_fields): New function. (streamer_pack_tree_bitfields): Call it. (streamer_write_integer_cst): Adjust. From-SVN: r192559
Diffstat (limited to 'gcc/tree-streamer-out.c')
-rw-r--r--gcc/tree-streamer-out.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c
index ee5e311..1f0eb55 100644
--- a/gcc/tree-streamer-out.c
+++ b/gcc/tree-streamer-out.c
@@ -112,6 +112,17 @@ pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
}
+/* Pack all the non-pointer fields of the TS_INTEGER_CST structure of
+ expression EXPR into bitpack BP. */
+
+static void
+pack_ts_int_cst_value_fields (struct bitpack_d *bp, tree expr)
+{
+ bp_pack_var_len_unsigned (bp, TREE_INT_CST_LOW (expr));
+ bp_pack_var_len_int (bp, TREE_INT_CST_HIGH (expr));
+}
+
+
/* Pack all the non-pointer fields of the TS_REAL_CST structure of
expression EXPR into bitpack BP. */
@@ -373,6 +384,9 @@ streamer_pack_tree_bitfields (struct output_block *ob,
the types and sizes of each of the fields being packed. */
pack_ts_base_value_fields (bp, expr);
+ if (CODE_CONTAINS_STRUCT (code, TS_INT_CST))
+ pack_ts_int_cst_value_fields (bp, expr);
+
if (CODE_CONTAINS_STRUCT (code, TS_REAL_CST))
pack_ts_real_cst_value_fields (bp, expr);
@@ -935,9 +949,9 @@ streamer_write_tree_header (struct output_block *ob, tree expr)
void
streamer_write_integer_cst (struct output_block *ob, tree cst, bool ref_p)
{
- streamer_write_record_start (ob, lto_tree_code_to_tag (INTEGER_CST));
+ gcc_assert (!TREE_OVERFLOW (cst));
+ streamer_write_record_start (ob, LTO_integer_cst);
stream_write_tree (ob, TREE_TYPE (cst), ref_p);
- streamer_write_char_stream (ob->main_stream, TREE_OVERFLOW_P (cst));
streamer_write_uhwi (ob, TREE_INT_CST_LOW (cst));
- streamer_write_uhwi (ob, TREE_INT_CST_HIGH (cst));
+ streamer_write_hwi (ob, TREE_INT_CST_HIGH (cst));
}