aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 17b6cfd..a671c67 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -451,7 +451,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
streamer_write_hwi_stream (ob->main_stream, ref);
- lto_output_fn_decl_index (ob->decl_state, ob->main_stream, node->decl);
+ lto_output_fn_decl_ref (ob->decl_state, ob->main_stream, node->decl);
node->count.stream_out (ob->main_stream);
streamer_write_hwi_stream (ob->main_stream, node->count_materialization_scale);
@@ -591,7 +591,7 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, varpool_node *node,
streamer_write_enum (ob->main_stream, LTO_symtab_tags, LTO_symtab_last_tag,
LTO_symtab_variable);
streamer_write_hwi_stream (ob->main_stream, node->order);
- lto_output_var_decl_index (ob->decl_state, ob->main_stream, node->decl);
+ lto_output_var_decl_ref (ob->decl_state, ob->main_stream, node->decl);
bp = bitpack_create (ob->main_stream);
bp_pack_value (&bp, node->externally_visible, 1);
bp_pack_value (&bp, node->no_reorder, 1);
@@ -1071,16 +1071,16 @@ output_offload_tables (void)
{
streamer_write_enum (ob->main_stream, LTO_symtab_tags,
LTO_symtab_last_tag, LTO_symtab_unavail_node);
- lto_output_fn_decl_index (ob->decl_state, ob->main_stream,
- (*offload_funcs)[i]);
+ lto_output_fn_decl_ref (ob->decl_state, ob->main_stream,
+ (*offload_funcs)[i]);
}
for (unsigned i = 0; i < vec_safe_length (offload_vars); i++)
{
streamer_write_enum (ob->main_stream, LTO_symtab_tags,
LTO_symtab_last_tag, LTO_symtab_variable);
- lto_output_var_decl_index (ob->decl_state, ob->main_stream,
- (*offload_vars)[i]);
+ lto_output_var_decl_ref (ob->decl_state, ob->main_stream,
+ (*offload_vars)[i]);
}
streamer_write_uhwi_stream (ob->main_stream, 0);
@@ -1219,7 +1219,6 @@ input_node (struct lto_file_decl_data *file_data,
tree fn_decl;
struct cgraph_node *node;
struct bitpack_d bp;
- unsigned decl_index;
int ref = LCC_NOT_FOUND, ref2 = LCC_NOT_FOUND;
int clone_ref;
int order;
@@ -1229,8 +1228,7 @@ input_node (struct lto_file_decl_data *file_data,
order = streamer_read_hwi (ib) + file_data->order_base;
clone_ref = streamer_read_hwi (ib);
- decl_index = streamer_read_uhwi (ib);
- fn_decl = lto_file_decl_data_get_fn_decl (file_data, decl_index);
+ fn_decl = lto_input_fn_decl_ref (ib, file_data);
if (clone_ref != LCC_NOT_FOUND)
{
@@ -1339,7 +1337,6 @@ static varpool_node *
input_varpool_node (struct lto_file_decl_data *file_data,
class lto_input_block *ib)
{
- int decl_index;
tree var_decl;
varpool_node *node;
struct bitpack_d bp;
@@ -1349,8 +1346,7 @@ input_varpool_node (struct lto_file_decl_data *file_data,
const char *section;
order = streamer_read_hwi (ib) + file_data->order_base;
- decl_index = streamer_read_uhwi (ib);
- var_decl = lto_file_decl_data_get_var_decl (file_data, decl_index);
+ var_decl = lto_input_var_decl_ref (ib, file_data);
/* Declaration of functions can be already merged with a declaration
from other input file. We keep cgraph unmerged until after streaming
@@ -1781,9 +1777,8 @@ input_offload_tables (bool do_force_output)
{
if (tag == LTO_symtab_unavail_node)
{
- int decl_index = streamer_read_uhwi (ib);
tree fn_decl
- = lto_file_decl_data_get_fn_decl (file_data, decl_index);
+ = lto_input_fn_decl_ref (ib, file_data);
vec_safe_push (offload_funcs, fn_decl);
/* Prevent IPA from removing fn_decl as unreachable, since there
@@ -1794,9 +1789,8 @@ input_offload_tables (bool do_force_output)
}
else if (tag == LTO_symtab_variable)
{
- int decl_index = streamer_read_uhwi (ib);
tree var_decl
- = lto_file_decl_data_get_var_decl (file_data, decl_index);
+ = lto_input_var_decl_ref (ib, file_data);
vec_safe_push (offload_vars, var_decl);
/* Prevent IPA from removing var_decl as unused, since there