diff options
author | Richard Guenther <rguenther@suse.de> | 2012-10-18 10:59:55 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-10-18 10:59:55 +0000 |
commit | c61f8c3b79e093c3485d1b381a04b482c7edf885 (patch) | |
tree | ca0e67dc21d055b07a4151f583dd237d2349044d /gcc/tree-streamer-in.c | |
parent | 595fefee5d18e9a08f2e7b1be156be4ace719a6f (diff) | |
download | gcc-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-in.c')
-rw-r--r-- | gcc/tree-streamer-in.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c index 9e1e975..f573659 100644 --- a/gcc/tree-streamer-in.c +++ b/gcc/tree-streamer-in.c @@ -140,6 +140,17 @@ unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr) } +/* Unpack all the non-pointer fields of the TS_INT_CST structure of + expression EXPR from bitpack BP. */ + +static void +unpack_ts_int_cst_value_fields (struct bitpack_d *bp, tree expr) +{ + TREE_INT_CST_LOW (expr) = (unsigned) bp_unpack_var_len_unsigned (bp); + TREE_INT_CST_HIGH (expr) = (unsigned) bp_unpack_var_len_int (bp); +} + + /* Unpack all the non-pointer fields of the TS_REAL_CST structure of expression EXPR from bitpack BP. */ @@ -416,6 +427,9 @@ unpack_value_fields (struct data_in *data_in, struct bitpack_d *bp, tree expr) the types and sizes of each of the fields being packed. */ unpack_ts_base_value_fields (bp, expr); + if (CODE_CONTAINS_STRUCT (code, TS_INT_CST)) + unpack_ts_int_cst_value_fields (bp, expr); + if (CODE_CONTAINS_STRUCT (code, TS_REAL_CST)) unpack_ts_real_cst_value_fields (bp, expr); @@ -1012,25 +1026,10 @@ streamer_read_tree_body (struct lto_input_block *ib, struct data_in *data_in, tree streamer_read_integer_cst (struct lto_input_block *ib, struct data_in *data_in) { - tree result, type; - HOST_WIDE_INT low, high; - bool overflow_p; - - type = stream_read_tree (ib, data_in); - overflow_p = (streamer_read_uchar (ib) != 0); - low = streamer_read_uhwi (ib); - high = streamer_read_uhwi (ib); - result = build_int_cst_wide (type, low, high); - - /* If the original constant had overflown, build a replica of RESULT to - avoid modifying the shared constant returned by build_int_cst_wide. */ - if (overflow_p) - { - result = copy_node (result); - TREE_OVERFLOW (result) = 1; - } - - return result; + tree type = stream_read_tree (ib, data_in); + unsigned HOST_WIDE_INT low = streamer_read_uhwi (ib); + HOST_WIDE_INT high = streamer_read_hwi (ib); + return build_int_cst_wide (type, low, high); } |