Commit 07233947 by Diego Novillo Committed by Diego Novillo

lto-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call…

lto-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call output_record_start with LTO_null instead of output_zero.

	* lto-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call
	output_record_start with LTO_null instead of output_zero.
	(lto_output_ts_binfo_tree_pointers): Likewise.
	(lto_output_tree): Likewise.
	(output_eh_try_list): Likewise.
	(output_eh_region): Likewise.
	(output_eh_lp): Likewise.
	(output_eh_regions): Likewise.
	(output_bb): Likewise.
	(output_function): Likewise.
	(output_unreferenced_globals): Likewise.
	* lto-streamer.h (enum LTO_tags): Reserve MAX_TREE_CODES
	instead of NUM_TREE_CODES.
	(lto_tag_is_tree_code_p): Check max value against MAX_TREE_CODES.
	(lto_output_int_in_range): Change << to >> when shifting VAL.

From-SVN: r174544
parent 4324a55c
2011-06-01 Diego Novillo <dnovillo@google.com> 2011-06-01 Diego Novillo <dnovillo@google.com>
* lto-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call
output_record_start with LTO_null instead of output_zero.
(lto_output_ts_binfo_tree_pointers): Likewise.
(lto_output_tree): Likewise.
(output_eh_try_list): Likewise.
(output_eh_region): Likewise.
(output_eh_lp): Likewise.
(output_eh_regions): Likewise.
(output_bb): Likewise.
(output_function): Likewise.
(output_unreferenced_globals): Likewise.
* lto-streamer.h (enum LTO_tags): Reserve MAX_TREE_CODES
instead of NUM_TREE_CODES.
(lto_tag_is_tree_code_p): Check max value against MAX_TREE_CODES.
(lto_output_int_in_range): Change << to >> when shifting VAL.
2011-06-01 Diego Novillo <dnovillo@google.com>
* lto-streamer-out.c (lto_output_ts_decl_non_common_tree_pointers): * lto-streamer-out.c (lto_output_ts_decl_non_common_tree_pointers):
Remove assertion for DECL_SAVED_TREE in FUNCTION_DECL nodes. Remove assertion for DECL_SAVED_TREE in FUNCTION_DECL nodes.
......
...@@ -950,7 +950,7 @@ lto_output_ts_decl_with_vis_tree_pointers (struct output_block *ob, tree expr, ...@@ -950,7 +950,7 @@ lto_output_ts_decl_with_vis_tree_pointers (struct output_block *ob, tree expr,
if (DECL_ASSEMBLER_NAME_SET_P (expr)) if (DECL_ASSEMBLER_NAME_SET_P (expr))
lto_output_tree_or_ref (ob, DECL_ASSEMBLER_NAME (expr), ref_p); lto_output_tree_or_ref (ob, DECL_ASSEMBLER_NAME (expr), ref_p);
else else
output_zero (ob); output_record_start (ob, LTO_null);
lto_output_tree_or_ref (ob, DECL_SECTION_NAME (expr), ref_p); lto_output_tree_or_ref (ob, DECL_SECTION_NAME (expr), ref_p);
lto_output_tree_or_ref (ob, DECL_COMDAT_GROUP (expr), ref_p); lto_output_tree_or_ref (ob, DECL_COMDAT_GROUP (expr), ref_p);
...@@ -1131,7 +1131,7 @@ lto_output_ts_binfo_tree_pointers (struct output_block *ob, tree expr, ...@@ -1131,7 +1131,7 @@ lto_output_ts_binfo_tree_pointers (struct output_block *ob, tree expr,
is needed to build the empty BINFO node on the reader side. */ is needed to build the empty BINFO node on the reader side. */
FOR_EACH_VEC_ELT (tree, BINFO_BASE_BINFOS (expr), i, t) FOR_EACH_VEC_ELT (tree, BINFO_BASE_BINFOS (expr), i, t)
lto_output_tree_or_ref (ob, t, ref_p); lto_output_tree_or_ref (ob, t, ref_p);
output_zero (ob); output_record_start (ob, LTO_null);
lto_output_tree_or_ref (ob, BINFO_OFFSET (expr), ref_p); lto_output_tree_or_ref (ob, BINFO_OFFSET (expr), ref_p);
lto_output_tree_or_ref (ob, BINFO_VTABLE (expr), ref_p); lto_output_tree_or_ref (ob, BINFO_VTABLE (expr), ref_p);
...@@ -1425,7 +1425,7 @@ lto_output_tree (struct output_block *ob, tree expr, bool ref_p) ...@@ -1425,7 +1425,7 @@ lto_output_tree (struct output_block *ob, tree expr, bool ref_p)
if (expr == NULL_TREE) if (expr == NULL_TREE)
{ {
output_zero (ob); output_record_start (ob, LTO_null);
return; return;
} }
...@@ -1481,7 +1481,7 @@ output_eh_try_list (struct output_block *ob, eh_catch first) ...@@ -1481,7 +1481,7 @@ output_eh_try_list (struct output_block *ob, eh_catch first)
lto_output_tree_ref (ob, n->label); lto_output_tree_ref (ob, n->label);
} }
output_zero (ob); output_record_start (ob, LTO_null);
} }
...@@ -1496,7 +1496,7 @@ output_eh_region (struct output_block *ob, eh_region r) ...@@ -1496,7 +1496,7 @@ output_eh_region (struct output_block *ob, eh_region r)
if (r == NULL) if (r == NULL)
{ {
output_zero (ob); output_record_start (ob, LTO_null);
return; return;
} }
...@@ -1559,7 +1559,7 @@ output_eh_lp (struct output_block *ob, eh_landing_pad lp) ...@@ -1559,7 +1559,7 @@ output_eh_lp (struct output_block *ob, eh_landing_pad lp)
{ {
if (lp == NULL) if (lp == NULL)
{ {
output_zero (ob); output_record_start (ob, LTO_null);
return; return;
} }
...@@ -1628,9 +1628,9 @@ output_eh_regions (struct output_block *ob, struct function *fn) ...@@ -1628,9 +1628,9 @@ output_eh_regions (struct output_block *ob, struct function *fn)
} }
} }
/* The 0 either terminates the record or indicates that there are no /* The LTO_null either terminates the record or indicates that there
eh_records at all. */ are no eh_records at all. */
output_zero (ob); output_record_start (ob, LTO_null);
} }
...@@ -1875,10 +1875,10 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn) ...@@ -1875,10 +1875,10 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn)
output_sleb128 (ob, region); output_sleb128 (ob, region);
} }
else else
output_zero (ob); output_record_start (ob, LTO_null);
} }
output_zero (ob); output_record_start (ob, LTO_null);
for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi)) for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{ {
...@@ -1891,7 +1891,7 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn) ...@@ -1891,7 +1891,7 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn)
output_phi (ob, phi); output_phi (ob, phi);
} }
output_zero (ob); output_record_start (ob, LTO_null);
} }
} }
...@@ -2048,7 +2048,7 @@ output_function (struct cgraph_node *node) ...@@ -2048,7 +2048,7 @@ output_function (struct cgraph_node *node)
output_bb (ob, bb, fn); output_bb (ob, bb, fn);
/* The terminator for this function. */ /* The terminator for this function. */
output_zero (ob); output_record_start (ob, LTO_null);
output_cfg (ob, fn); output_cfg (ob, fn);
...@@ -2162,7 +2162,7 @@ output_unreferenced_globals (cgraph_node_set set, varpool_node_set vset) ...@@ -2162,7 +2162,7 @@ output_unreferenced_globals (cgraph_node_set set, varpool_node_set vset)
} }
symbol_alias_set_destroy (defined); symbol_alias_set_destroy (defined);
output_zero (ob); output_record_start (ob, LTO_null);
produce_asm (ob, NULL); produce_asm (ob, NULL);
destroy_output_block (ob); destroy_output_block (ob);
......
...@@ -186,7 +186,7 @@ enum LTO_tags ...@@ -186,7 +186,7 @@ enum LTO_tags
Conversely, to map between LTO tags and tree/gimple codes, the Conversely, to map between LTO tags and tree/gimple codes, the
reverse operation must be applied. */ reverse operation must be applied. */
LTO_bb0 = 1 + NUM_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE, LTO_bb0 = 1 + MAX_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE,
LTO_bb1, LTO_bb1,
/* EH region holding the previous statement. */ /* EH region holding the previous statement. */
...@@ -957,7 +957,7 @@ extern VEC(lto_out_decl_state_ptr, heap) *lto_function_decl_states; ...@@ -957,7 +957,7 @@ extern VEC(lto_out_decl_state_ptr, heap) *lto_function_decl_states;
static inline bool static inline bool
lto_tag_is_tree_code_p (enum LTO_tags tag) lto_tag_is_tree_code_p (enum LTO_tags tag)
{ {
return tag > LTO_null && (unsigned) tag <= NUM_TREE_CODES; return tag > LTO_null && (unsigned) tag <= MAX_TREE_CODES;
} }
...@@ -1226,11 +1226,11 @@ lto_output_int_in_range (struct lto_output_stream *obs, ...@@ -1226,11 +1226,11 @@ lto_output_int_in_range (struct lto_output_stream *obs,
val -= min; val -= min;
lto_output_1_stream (obs, val & 255); lto_output_1_stream (obs, val & 255);
if (range >= 0xff) if (range >= 0xff)
lto_output_1_stream (obs, (val << 8) & 255); lto_output_1_stream (obs, (val >> 8) & 255);
if (range >= 0xffff) if (range >= 0xffff)
lto_output_1_stream (obs, (val << 16) & 255); lto_output_1_stream (obs, (val >> 16) & 255);
if (range >= 0xffffff) if (range >= 0xffffff)
lto_output_1_stream (obs, (val << 24) & 255); lto_output_1_stream (obs, (val >> 24) & 255);
} }
/* Input VAL into OBS and verify it is in range MIN...MAX that is supposed /* Input VAL into OBS and verify it is in range MIN...MAX that is supposed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment