/* Callgraph based analysis of static variables.
- Copyright (C) 2004-2019 Free Software Foundation, Inc.
+ Copyright (C) 2004-2020 Free Software Foundation, Inc.
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
This file is part of GCC.
#include "calls.h"
#include "ipa-utils.h"
#include "ipa-reference.h"
+#include "alloc-pool.h"
#include "symbol-summary.h"
/* The static variables defined within the compilation unit that are
info->local.statics_read = BITMAP_ALLOC (&local_info_obstack);
info->local.statics_written = BITMAP_ALLOC (&local_info_obstack);
+ info->global.statics_read = NULL;
return &info->local;
}
ipa_reference_global_vars_info_t node_g;
/* No need to produce summaries for inline clones. */
- if (node->global.inlined_to)
+ if (node->inlined_to)
continue;
node_info = get_reference_vars_info (node);
ipa_reference_optimization_summary_t info;
/* See if we have (non-empty) info. */
- if (!node->definition || node->global.inlined_to)
+ if (!node->definition || node->inlined_to)
return false;
info = get_reference_optimization_summary (node);
if (!info)
EXECUTE_IF_AND_IN_BITMAP (bits, ltrans_statics, 0, index, bi)
{
tree decl = (*reference_vars_to_consider) [index];
- lto_output_var_decl_index (ob->decl_state, ob->main_stream, decl);
+ lto_output_var_decl_ref (ob->decl_state, ob->main_stream, decl);
}
}
int i;
vec_alloc (reference_vars_to_consider, ipa_reference_vars_uids);
- reference_vars_to_consider->safe_grow (ipa_reference_vars_uids);
+ reference_vars_to_consider->safe_grow (ipa_reference_vars_uids, true);
/* See what variables we are interested in. */
for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
fprintf (dump_file, "all module statics:");
for (i = 0; i < (unsigned int)b_count; i++)
{
- unsigned int var_index = streamer_read_uhwi (ib);
- tree v_decl = lto_file_decl_data_get_var_decl (file_data,
- var_index);
+ tree v_decl = lto_input_var_decl_ref (ib, file_data);
bool existed;
bitmap_set_bit (all_module_statics,
ipa_reference_var_get_or_insert_uid
(&optimization_summary_obstack);
for (j = 0; j < (unsigned int)v_count; j++)
{
- unsigned int var_index = streamer_read_uhwi (ib);
- tree v_decl = lto_file_decl_data_get_var_decl (file_data,
- var_index);
+ tree v_decl = lto_input_var_decl_ref (ib, file_data);
bitmap_set_bit (info->statics_read,
ipa_reference_var_uid (v_decl));
if (dump_file)
(&optimization_summary_obstack);
for (j = 0; j < (unsigned int)v_count; j++)
{
- unsigned int var_index = streamer_read_uhwi (ib);
- tree v_decl = lto_file_decl_data_get_var_decl (file_data,
- var_index);
+ tree v_decl = lto_input_var_decl_ref (ib, file_data);
bitmap_set_bit (info->statics_written,
ipa_reference_var_uid (v_decl));
if (dump_file)