to the global decls section as we do not want to have them
enter decl merging. This is, of course, only for the call
for streaming BLOCK_VARS, but other callers are safe. */
- stream_write_tree (ob, t,
- ref_p && !(VAR_OR_FUNCTION_DECL_P (t)
- && DECL_EXTERNAL (t)));
+ if (VAR_OR_FUNCTION_DECL_P (t)
+ && DECL_EXTERNAL (t))
+ stream_write_tree_shallow_non_ref (ob, t, ref_p);
+ else
+ stream_write_tree (ob, t, ref_p);
TREE_CHAIN (t) = saved_chain;
t = TREE_CHAIN (t);
{
stream_write_tree (ob, DECL_FIELD_OFFSET (expr), ref_p);
stream_write_tree (ob, DECL_BIT_FIELD_TYPE (expr), ref_p);
- stream_write_tree (ob, DECL_QUALIFIER (expr), ref_p);
+ /* Do not stream DECL_QUALIFIER, it is useless after gimplification. */
stream_write_tree (ob, DECL_FIELD_BIT_OFFSET (expr), ref_p);
stream_write_tree (ob, DECL_FCONTEXT (expr), ref_p);
}
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
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);
}