tree
stream_read_tree_ref (lto_input_block *ib, data_in *data_in)
{
- unsigned ix = streamer_read_uhwi (ib);
- tree ret;
+ int ix = streamer_read_hwi (ib);
if (!ix)
return NULL_TREE;
- else if (ix < LTO_NUM_TAGS)
- ret = lto_input_tree_ref (ib, data_in, cfun, (LTO_tags)ix);
+ if (ix > 0)
+ return streamer_tree_cache_get_tree (data_in->reader_cache, ix - 1);
+
+ ix = -ix - 1;
+ int id = ix & 1;
+ ix /= 2;
+
+ tree ret;
+ if (!id)
+ ret = (*data_in->file_data->current_decl_state
+ ->streams[LTO_DECL_STREAM])[ix];
else
- ret = streamer_tree_cache_get_tree (data_in->reader_cache,
- ix - LTO_NUM_TAGS);
- if (ret && streamer_debugging)
- {
- enum tree_code c = (enum tree_code)streamer_read_uhwi (ib);
- gcc_assert (c == TREE_CODE (ret));
- }
+ ret = (*SSANAMES (cfun))[ix];
return ret;
}
unsigned int ix;
bool existed_p = streamer_tree_cache_lookup (ob->writer_cache, t, &ix);
if (existed_p)
- streamer_write_uhwi (ob, ix + LTO_NUM_TAGS);
+ streamer_write_hwi (ob, ix + 1);
else
{
enum LTO_tags tag;
unsigned ix;
+ int id = 0;
lto_indexable_tree_ref (ob, t, &tag, &ix);
- streamer_write_uhwi (ob, tag);
- streamer_write_uhwi (ob, ix);
+ if (tag == LTO_ssa_name_ref)
+ id = 1;
+ else
+ gcc_checking_assert (tag == LTO_global_stream_ref);
+ streamer_write_hwi (ob, -(int)(ix * 2 + id + 1));
}
if (streamer_debugging)
streamer_write_uhwi (ob, TREE_CODE (t));