diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-12 12:14:48 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-12 12:14:48 +0000 |
commit | 51136fa7e353d69e468e7ecc37e310e3e38ab420 (patch) | |
tree | c984d5bf61b729a9977d8afce864a8758acf87d1 /gcc/tree-streamer-out.c | |
parent | a56938284872d9083b8e3735f5ad5af3d0121ce1 (diff) | |
download | gcc-51136fa7e353d69e468e7ecc37e310e3e38ab420.tar.gz |
2012-10-12 Richard Biener <rguenther@suse.de>
* tree-streamer-out.c (pack_ts_target_option): Rename from ...
(write_ts_target_option): ... this.
(pack_ts_optimization): Rename from ...
(write_ts_optimization): ... this.
(streamer_pack_tree_bitfields): Pack them in the bitfield section ...
(streamer_write_tree_body): ... not here.
* tree-streamer-in.c (unpack_ts_target_option): Rename from ...
(lto_input_ts_target_option): ... this.
(unpack_ts_optimization): Rename from ...
(lto_input_ts_optimization): ... this.
(unpack_value_fields): Unpack them from the bitfield section ...
(streamer_read_tree_body): ... not from here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192398 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-streamer-out.c')
-rw-r--r-- | gcc/tree-streamer-out.c | 90 |
1 files changed, 42 insertions, 48 deletions
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index 73ffb301fda..fc70eb9f856 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -320,6 +320,42 @@ pack_ts_translation_unit_decl_value_fields (struct bitpack_d *bp ATTRIBUTE_UNUSE { } +/* Pack a TS_TARGET_OPTION tree in EXPR to BP. */ + +static void +pack_ts_target_option (struct bitpack_d *bp, tree expr) +{ + struct cl_target_option *t = TREE_TARGET_OPTION (expr); + unsigned i, len; + + /* The cl_target_option is target specific and generated by the options + awk script, so we just recreate a byte-by-byte copy here. */ + + len = sizeof (struct cl_target_option); + for (i = 0; i < len; i++) + bp_pack_value (bp, ((unsigned char *)t)[i], 8); + /* Catch struct size mismatches between reader and writer. */ + bp_pack_value (bp, 0x12345678, 32); +} + +/* Pack a TS_OPTIMIZATION tree in EXPR to BP. */ + +static void +pack_ts_optimization (struct bitpack_d *bp, tree expr) +{ + struct cl_optimization *t = TREE_OPTIMIZATION (expr); + unsigned i, len; + + /* The cl_optimization is generated by the options + awk script, so we just recreate a byte-by-byte copy here. */ + + len = sizeof (struct cl_optimization); + for (i = 0; i < len; i++) + bp_pack_value (bp, ((unsigned char *)t)[i], 8); + /* Catch struct size mismatches between reader and writer. */ + bp_pack_value (bp, 0x12345678, 32); +} + /* Pack all the bitfields in EXPR into a bit pack. */ @@ -367,6 +403,12 @@ streamer_pack_tree_bitfields (struct output_block *ob, if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL)) pack_ts_translation_unit_decl_value_fields (bp, expr); + + if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION)) + pack_ts_target_option (bp, expr); + + if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION)) + pack_ts_optimization (bp, expr); } @@ -773,48 +815,6 @@ write_ts_constructor_tree_pointers (struct output_block *ob, tree expr, } } -/* Write a TS_TARGET_OPTION tree in EXPR to OB. */ - -static void -write_ts_target_option (struct output_block *ob, tree expr) -{ - struct cl_target_option *t = TREE_TARGET_OPTION (expr); - struct bitpack_d bp; - unsigned i, len; - - /* The cl_target_option is target specific and generated by the options - awk script, so we just recreate a byte-by-byte copy here. */ - - bp = bitpack_create (ob->main_stream); - len = sizeof (struct cl_target_option); - for (i = 0; i < len; i++) - bp_pack_value (&bp, ((unsigned char *)t)[i], 8); - /* Catch struct size mismatches between reader and writer. */ - bp_pack_value (&bp, 0x12345678, 32); - streamer_write_bitpack (&bp); -} - -/* Write a TS_OPTIMIZATION tree in EXPR to OB. */ - -static void -write_ts_optimization (struct output_block *ob, tree expr) -{ - struct cl_optimization *t = TREE_OPTIMIZATION (expr); - struct bitpack_d bp; - unsigned i, len; - - /* The cl_optimization is generated by the options - awk script, so we just recreate a byte-by-byte copy here. */ - - bp = bitpack_create (ob->main_stream); - len = sizeof (struct cl_optimization); - for (i = 0; i < len; i++) - bp_pack_value (&bp, ((unsigned char *)t)[i], 8); - /* Catch struct size mismatches between reader and writer. */ - bp_pack_value (&bp, 0x12345678, 32); - streamer_write_bitpack (&bp); -} - /* Write a TS_TRANSLATION_UNIT_DECL tree in EXPR to OB. */ static void @@ -886,12 +886,6 @@ streamer_write_tree_body (struct output_block *ob, tree expr, bool ref_p) if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR)) write_ts_constructor_tree_pointers (ob, expr, ref_p); - if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION)) - write_ts_target_option (ob, expr); - - if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION)) - write_ts_optimization (ob, expr); - if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL)) write_ts_translation_unit_decl_tree_pointers (ob, expr); } |