diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-18 10:59:55 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-18 10:59:55 +0000 |
commit | 42603940fde7be4644044619ebdc5d262ff0422d (patch) | |
tree | ca0e67dc21d055b07a4151f583dd237d2349044d /gcc/tree-streamer-out.c | |
parent | 530c2b2e4873415e89a90065ba18ec739dd4ebcb (diff) | |
download | gcc-42603940fde7be4644044619ebdc5d262ff0422d.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192559 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-streamer-out.c')
-rw-r--r-- | gcc/tree-streamer-out.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index ee5e31172b9..1f0eb55ec44 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)); } |