tree-streamer-out.c (pack_ts_target_option): Rename from ...

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.

From-SVN: r192398
This commit is contained in:
Richard Biener 2012-10-12 12:14:48 +00:00 committed by Richard Biener
parent aec06f6fa8
commit 0889c5c3fa
3 changed files with 94 additions and 88 deletions

View File

@ -1,3 +1,18 @@
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.
2012-10-12 Uros Bizjak <ubizjak@gmail.com>
* config/alpha/alpha.md (vecmodesuffix): New mode attribute.

View File

@ -370,6 +370,37 @@ unpack_ts_translation_unit_decl_value_fields (struct bitpack_d *bp ATTRIBUTE_UNU
{
}
/* Unpack a TS_TARGET_OPTION tree from BP into EXPR. */
static void
unpack_ts_target_option (struct bitpack_d *bp, tree expr)
{
unsigned i, len;
struct cl_target_option *t = TREE_TARGET_OPTION (expr);
len = sizeof (struct cl_target_option);
for (i = 0; i < len; i++)
((unsigned char *)t)[i] = bp_unpack_value (bp, 8);
if (bp_unpack_value (bp, 32) != 0x12345678)
fatal_error ("cl_target_option size mismatch in LTO reader and writer");
}
/* Unpack a TS_OPTIMIZATION tree from BP into EXPR. */
static void
unpack_ts_optimization (struct bitpack_d *bp, tree expr)
{
unsigned i, len;
struct cl_optimization *t = TREE_OPTIMIZATION (expr);
len = sizeof (struct cl_optimization);
for (i = 0; i < len; i++)
((unsigned char *)t)[i] = bp_unpack_value (bp, 8);
if (bp_unpack_value (bp, 32) != 0x12345678)
fatal_error ("cl_optimization size mismatch in LTO reader and writer");
}
/* Unpack all the non-pointer fields in EXPR into a bit pack. */
static void
@ -415,6 +446,12 @@ unpack_value_fields (struct data_in *data_in, struct bitpack_d *bp, tree expr)
if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL))
unpack_ts_translation_unit_decl_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
unpack_ts_target_option (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
unpack_ts_optimization (bp, expr);
}
@ -900,40 +937,6 @@ lto_input_ts_constructor_tree_pointers (struct lto_input_block *ib,
}
/* Input a TS_TARGET_OPTION tree from IB into EXPR. */
static void
lto_input_ts_target_option (struct lto_input_block *ib, tree expr)
{
unsigned i, len;
struct bitpack_d bp;
struct cl_target_option *t = TREE_TARGET_OPTION (expr);
bp = streamer_read_bitpack (ib);
len = sizeof (struct cl_target_option);
for (i = 0; i < len; i++)
((unsigned char *)t)[i] = bp_unpack_value (&bp, 8);
if (bp_unpack_value (&bp, 32) != 0x12345678)
fatal_error ("cl_target_option size mismatch in LTO reader and writer");
}
/* Input a TS_OPTIMIZATION tree from IB into EXPR. */
static void
lto_input_ts_optimization (struct lto_input_block *ib, tree expr)
{
unsigned i, len;
struct bitpack_d bp;
struct cl_optimization *t = TREE_OPTIMIZATION (expr);
bp = streamer_read_bitpack (ib);
len = sizeof (struct cl_optimization);
for (i = 0; i < len; i++)
((unsigned char *)t)[i] = bp_unpack_value (&bp, 8);
if (bp_unpack_value (&bp, 32) != 0x12345678)
fatal_error ("cl_optimization size mismatch in LTO reader and writer");
}
/* Input a TS_TRANSLATION_UNIT_DECL tree from IB and DATA_IN into EXPR. */
static void
@ -1007,12 +1010,6 @@ streamer_read_tree_body (struct lto_input_block *ib, struct data_in *data_in,
if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
lto_input_ts_constructor_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
lto_input_ts_target_option (ib, expr);
if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
lto_input_ts_optimization (ib, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL))
lto_input_ts_translation_unit_decl_tree_pointers (ib, data_in, expr);
}

View File

@ -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);
}