summaryrefslogtreecommitdiff
path: root/gcc/tree-streamer-out.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-05 15:43:54 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-05 15:43:54 +0000
commit8a3acf3f759c74ee235bad124bbd4380361d3fb0 (patch)
treef5f2a9f356b5b265ba6c2695f02cd6f9104bdf17 /gcc/tree-streamer-out.c
parent451067f0e4e10fb0b73451d1f3f52334bd652eac (diff)
downloadgcc-8a3acf3f759c74ee235bad124bbd4380361d3fb0.tar.gz
2012-01-05 Richard Guenther <rguenther@suse.de>
PR lto/50490 * tree-streamer-out.c (write_ts_optimization): New function. (streamer_write_tree_body): Call it. * tree-streamer-in.c (lto_input_ts_optimization): New function. (streamer_read_tree_body): Call it. * lto-streamer-out.c (lto_is_streamable): Handle OPTIMIZATION_NODE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182917 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-streamer-out.c')
-rw-r--r--gcc/tree-streamer-out.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c
index 17b5be78c7c..df8b92aa102 100644
--- a/gcc/tree-streamer-out.c
+++ b/gcc/tree-streamer-out.c
@@ -767,6 +767,27 @@ write_ts_target_option (struct output_block *ob, tree expr)
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_optimizaation 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
@@ -841,6 +862,9 @@ streamer_write_tree_body (struct output_block *ob, tree expr, bool 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);
}