/* Callgraph based analysis of static variables.
- Copyright (C) 2004-2018 Free Software Foundation, Inc.
+ Copyright (C) 2004-2019 Free Software Foundation, Inc.
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
This file is part of GCC.
/* Obstack holding global analysis live forever. */
static bitmap_obstack optimization_summary_obstack;
-class ipa_ref_var_info_summary_t: public function_summary
- <ipa_reference_vars_info_d *>
+class ipa_ref_var_info_summary_t: public fast_function_summary
+ <ipa_reference_vars_info_d *, va_heap>
{
public:
ipa_ref_var_info_summary_t (symbol_table *symtab):
- function_summary <ipa_reference_vars_info_d *> (symtab) {}
+ fast_function_summary <ipa_reference_vars_info_d *, va_heap> (symtab) {}
};
static ipa_ref_var_info_summary_t *ipa_ref_var_info_summaries = NULL;
-class ipa_ref_opt_summary_t: public function_summary
- <ipa_reference_optimization_summary_d *>
+class ipa_ref_opt_summary_t: public fast_function_summary
+ <ipa_reference_optimization_summary_d *, va_heap>
{
public:
ipa_ref_opt_summary_t (symbol_table *symtab):
- function_summary <ipa_reference_optimization_summary_d *> (symtab) {}
-
+ fast_function_summary <ipa_reference_optimization_summary_d *, va_heap> (symtab) {}
virtual void remove (cgraph_node *src_node,
ipa_reference_optimization_summary_d *data);
if (TREE_READONLY (t))
return true;
- /* We can not track variables with address taken. */
+ /* We cannot track variables with address taken. */
if (TREE_ADDRESSABLE (t))
return true;
{
struct cgraph_edge *e, *ie;
- /* When function is overwritable, we can not assume anything. */
+ /* When function is overwritable, we cannot assume anything. */
if (node->get_availability () <= AVAIL_INTERPOSABLE
|| (node->analyzed && !opt_for_fn (node->decl, flag_ipa_reference)))
read_write_all_from_decl (node, read_all, write_all);
}
}
-/* Skip edges from and to nodes without ipa_reference enables. This leave
- them out of strongy connected coponents and makes them easyto skip in the
+/* Skip edges from and to nodes without ipa_reference enabled.
+ Ignore not available symbols. This leave
+ them out of strongly connected components and makes them easy to skip in the
propagation loop bellow. */
static bool
ignore_edge_p (cgraph_edge *e)
{
- return (!opt_for_fn (e->caller->decl, flag_ipa_reference)
- || !opt_for_fn (e->callee->function_symbol ()->decl,
- flag_ipa_reference));
+ enum availability avail;
+ cgraph_node *ultimate_target
+ = e->callee->function_or_virtual_thunk_symbol (&avail, e->caller);
+
+ return (avail < AVAIL_INTERPOSABLE
+ || (avail == AVAIL_INTERPOSABLE
+ && !(flags_from_decl_or_type (e->callee->decl) & ECF_LEAF))
+ || !opt_for_fn (e->caller->decl, flag_ipa_reference)
+ || !opt_for_fn (ultimate_target->decl, flag_ipa_reference));
}
/* Produce the global information by preforming a transitive closure
if (dump_file)
cgraph_node::dump_cgraph (dump_file);
- remove_p = ipa_discover_readonly_nonaddressable_vars ();
+ remove_p = ipa_discover_variable_flags ();
generate_summary ();
/* Propagate the local information through the call graph to produce
the global information. All the nodes within a cycle will have
the same info so we collapse cycles first. Then we can do the
propagation in one pass from the leaves to the roots. */
- order_pos = ipa_reduced_postorder (order, true, true, ignore_edge_p);
+ order_pos = ipa_reduced_postorder (order, true, ignore_edge_p);
if (dump_file)
ipa_print_order (dump_file, "reduced", order, order_pos);
{
const char *data;
size_t len;
- struct lto_input_block *ib
+ class lto_input_block *ib
= lto_create_simple_input_block (file_data,
LTO_section_ipa_reference,
&data, &len);