aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2014-08-25 15:01:47 +0200
committerMartin Liska <marxin@gcc.gnu.org>2014-08-25 13:01:47 +0000
commit3dafb85c8e6ade82adc591fe97c116b193f8bb0d (patch)
tree6efa3ef534f8ca5761c35200d5cc61a819dde6f4 /gcc/lto
parent3749134042ab5f54d0c30af1ec336e7132ac9bc8 (diff)
downloadgcc-3dafb85c8e6ade82adc591fe97c116b193f8bb0d.zip
gcc-3dafb85c8e6ade82adc591fe97c116b193f8bb0d.tar.gz
gcc-3dafb85c8e6ade82adc591fe97c116b193f8bb0d.tar.bz2
IPA C++ refactoring 4/N
* cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/lto-partition.c58
-rw-r--r--gcc/lto/lto-symtab.c28
-rw-r--r--gcc/lto/lto.c57
3 files changed, 73 insertions, 70 deletions
diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c
index 1837b99..5bd089b 100644
--- a/gcc/lto/lto-partition.c
+++ b/gcc/lto/lto-partition.c
@@ -22,7 +22,6 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "toplev.h"
#include "tree.h"
-#include "gcc-symtab.h"
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
@@ -140,8 +139,9 @@ add_symbol_to_partition_1 (ltrans_partition part, symtab_node *node)
if (symbol_partitioned_p (node))
{
node->in_other_partition = 1;
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "Symbol node %s now used in multiple partitions\n",
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
+ "Symbol node %s now used in multiple partitions\n",
node->name ());
}
node->aux = (void *)((size_t)node->aux + 1);
@@ -413,7 +413,7 @@ lto_balanced_map (int n_lto_partitions)
{
int n_nodes = 0;
int n_varpool_nodes = 0, varpool_pos = 0, best_varpool_pos = 0;
- struct cgraph_node **order = XNEWVEC (struct cgraph_node *, cgraph_max_uid);
+ struct cgraph_node **order = XNEWVEC (cgraph_node *, symtab->cgraph_max_uid);
varpool_node **varpool_order = NULL;
int i;
struct cgraph_node *node;
@@ -446,9 +446,10 @@ lto_balanced_map (int n_lto_partitions)
things works smoother if we order in source order. */
qsort (order, n_nodes, sizeof (struct cgraph_node *), node_cmp);
- if (cgraph_dump_file)
+ if (symtab->dump_file)
for(i = 0; i < n_nodes; i++)
- fprintf (cgraph_dump_file, "Balanced map symbol order:%s:%u\n", order[i]->name (), order[i]->tp_first_run);
+ fprintf (symtab->dump_file, "Balanced map symbol order:%s:%u\n",
+ order[i]->name (), order[i]->tp_first_run);
if (!flag_toplevel_reorder)
{
@@ -471,8 +472,8 @@ lto_balanced_map (int n_lto_partitions)
partition_size = PARAM_VALUE (MIN_PARTITION_SIZE);
npartitions = 1;
partition = new_partition ("");
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "Total unit size: %i, partition size: %i\n",
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file, "Total unit size: %i, partition size: %i\n",
total_size, partition_size);
for (i = 0; i < n_nodes; i++)
@@ -657,8 +658,8 @@ lto_balanced_map (int n_lto_partitions)
best_total_size = total_size;
best_varpool_pos = varpool_pos;
}
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "Step %i: added %s/%i, size %i, cost %i/%i "
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file, "Step %i: added %s/%i, size %i, cost %i/%i "
"best %i/%i, step %i\n", i,
order[i]->name (), order[i]->order,
partition->insns, cost, internal,
@@ -669,8 +670,8 @@ lto_balanced_map (int n_lto_partitions)
{
if (best_i != i)
{
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "Unwinding %i insertions to step %i\n",
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file, "Unwinding %i insertions to step %i\n",
i - best_i, best_i);
undo_partition (partition, best_n_nodes);
varpool_pos = best_varpool_pos;
@@ -686,8 +687,8 @@ lto_balanced_map (int n_lto_partitions)
total_size = best_total_size;
cost = 0;
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "New partition\n");
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file, "New partition\n");
best_n_nodes = 0;
best_cost = INT_MAX;
@@ -744,8 +745,8 @@ privatize_symbol_name (symtab_node *node)
if (node->lto_file_data
&& lto_get_decl_name_mapping (node->lto_file_data, name) != name)
{
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
"Not privatizing symbol name: %s. It privatized already.\n",
name);
return false;
@@ -756,19 +757,20 @@ privatize_symbol_name (symtab_node *node)
that are not really clones. */
if (node->unique_name)
{
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
"Not privatizing symbol name: %s. Has unique name.\n",
name);
return false;
}
- change_decl_assembler_name (decl, clone_function_name (decl, "lto_priv"));
+ symtab->change_decl_assembler_name (decl,
+ clone_function_name (decl, "lto_priv"));
if (node->lto_file_data)
lto_record_renamed_decl (node->lto_file_data, name,
IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (decl)));
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
"Privatizing symbol name: %s -> %s\n",
name, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
return true;
@@ -793,8 +795,8 @@ promote_symbol (symtab_node *node)
TREE_PUBLIC (node->decl) = 1;
DECL_VISIBILITY (node->decl) = VISIBILITY_HIDDEN;
DECL_VISIBILITY_SPECIFIED (node->decl) = true;
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
"Promoting as hidden: %s\n", node->name ());
}
@@ -842,7 +844,7 @@ rename_statics (lto_symtab_encoder_t encoder, symtab_node *node)
/* Now walk symbols sharing the same name and see if there are any conflicts.
(all types of symbols counts here, since we can not have static of the
same name as external or public symbol.) */
- for (s = symtab_node_for_asm (name);
+ for (s = symtab_node::get_for_asmname (name);
s; s = s->next_sharing_asm_name)
if ((s->real_symbol_p () || may_need_named_section_p (encoder, s))
&& s->decl != node->decl
@@ -854,13 +856,13 @@ rename_statics (lto_symtab_encoder_t encoder, symtab_node *node)
if (!s)
return;
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
"Renaming statics with asm name: %s\n", node->name ());
/* Assign every symbol in the set that shares the same ASM name an unique
mangled name. */
- for (s = symtab_node_for_asm (name); s;)
+ for (s = symtab_node::get_for_asmname (name); s;)
if (!s->externally_visible
&& ((s->real_symbol_p ()
&& !DECL_EXTERNAL (node->decl)
@@ -871,7 +873,7 @@ rename_statics (lto_symtab_encoder_t encoder, symtab_node *node)
{
if (privatize_symbol_name (s))
/* Re-start from beginning since we do not know how many symbols changed a name. */
- s = symtab_node_for_asm (name);
+ s = symtab_node::get_for_asmname (name);
else s = s->next_sharing_asm_name;
}
else s = s->next_sharing_asm_name;
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index aae865a..cf000760 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -46,9 +46,9 @@ lto_cgraph_replace_node (struct cgraph_node *node,
struct cgraph_edge *e, *next;
bool compatible_p;
- if (cgraph_dump_file)
+ if (symtab->dump_file)
{
- fprintf (cgraph_dump_file, "Replacing cgraph node %s/%i by %s/%i"
+ fprintf (symtab->dump_file, "Replacing cgraph node %s/%i by %s/%i"
" for symbol %s\n",
node->name (), node->order,
prevailing_node->name (),
@@ -75,7 +75,7 @@ lto_cgraph_replace_node (struct cgraph_node *node,
for (e = node->callers; e; e = next)
{
next = e->next_caller;
- cgraph_redirect_edge_callee (e, prevailing_node);
+ e->redirect_callee (prevailing_node);
/* If there is a mismatch between the supposed callee return type and
the real one do not attempt to inline this function.
??? We really need a way to match function signatures for ABI
@@ -443,13 +443,13 @@ lto_symtab_merge_decls_1 (symtab_node *first)
symtab_node *prevailing;
bool diagnosed_p = false;
- if (cgraph_dump_file)
+ if (symtab->dump_file)
{
- fprintf (cgraph_dump_file, "Merging nodes for %s. Candidates:\n",
+ fprintf (symtab->dump_file, "Merging nodes for %s. Candidates:\n",
first->asm_name ());
for (e = first; e; e = e->next_sharing_asm_name)
if (TREE_PUBLIC (e->decl))
- e->dump (cgraph_dump_file);
+ e->dump (symtab->dump_file);
}
/* Compute the symbol resolutions. This is a no-op when using the
@@ -497,7 +497,7 @@ lto_symtab_merge_decls_1 (symtab_node *first)
}
}
- symtab_prevail_in_asm_name_hash (prevailing);
+ symtab->symtab_prevail_in_asm_name_hash (prevailing);
/* Diagnose mismatched objects. */
for (e = prevailing->next_sharing_asm_name;
@@ -539,11 +539,11 @@ lto_symtab_merge_decls_1 (symtab_node *first)
mismatches. */
lto_symtab_merge_decls_2 (prevailing, diagnosed_p);
- if (cgraph_dump_file)
+ if (symtab->dump_file)
{
- fprintf (cgraph_dump_file, "After resolution:\n");
+ fprintf (symtab->dump_file, "After resolution:\n");
for (e = prevailing; e; e = e->next_sharing_asm_name)
- e->dump (cgraph_dump_file);
+ e->dump (symtab->dump_file);
}
}
@@ -555,7 +555,7 @@ lto_symtab_merge_decls (void)
symtab_node *node;
/* Populate assembler name hash. */
- symtab_initialize_asm_name_hash ();
+ symtab->symtab_initialize_asm_name_hash ();
FOR_EACH_SYMBOL (node)
if (!node->previous_sharing_asm_name
@@ -599,7 +599,7 @@ lto_symtab_merge_symbols (void)
if (!flag_ltrans)
{
- symtab_initialize_asm_name_hash ();
+ symtab->symtab_initialize_asm_name_hash ();
/* Do the actual merging.
At this point we invalidate hash translating decls into symtab nodes
@@ -621,7 +621,7 @@ lto_symtab_merge_symbols (void)
if (!node->analyzed && node->alias_target)
{
- symtab_node *tgt = symtab_node_for_asm (node->alias_target);
+ symtab_node *tgt = symtab_node::get_for_asmname (node->alias_target);
gcc_assert (node->weakref);
if (tgt)
node->resolve_alias (tgt);
@@ -688,7 +688,7 @@ lto_symtab_prevailing_decl (tree decl)
gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
/* Walk through the list of candidates and return the one we merged to. */
- ret = symtab_node_for_asm (DECL_ASSEMBLER_NAME (decl));
+ ret = symtab_node::get_for_asmname (DECL_ASSEMBLER_NAME (decl));
if (!ret)
return decl;
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 62444ed..1ecbbce 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -2215,8 +2215,9 @@ lto_create_files_from_ids (lto_file *file, struct lto_file_decl_data *file_data,
int *count)
{
lto_file_finalize (file_data, file);
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "Creating file %s with sub id " HOST_WIDE_INT_PRINT_HEX "\n",
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
+ "Creating file %s with sub id " HOST_WIDE_INT_PRINT_HEX "\n",
file_data->file_name, file_data->id);
(*count)++;
return 0;
@@ -2595,41 +2596,41 @@ lto_wpa_write_files (void)
if (!quiet_flag)
fprintf (stderr, " %s (%s %i insns)", temp_filename, part->name, part->insns);
- if (cgraph_dump_file)
+ if (symtab->dump_file)
{
lto_symtab_encoder_iterator lsei;
- fprintf (cgraph_dump_file, "Writing partition %s to file %s, %i insns\n",
+ fprintf (symtab->dump_file, "Writing partition %s to file %s, %i insns\n",
part->name, temp_filename, part->insns);
- fprintf (cgraph_dump_file, " Symbols in partition: ");
+ fprintf (symtab->dump_file, " Symbols in partition: ");
for (lsei = lsei_start_in_partition (part->encoder); !lsei_end_p (lsei);
lsei_next_in_partition (&lsei))
{
symtab_node *node = lsei_node (lsei);
- fprintf (cgraph_dump_file, "%s ", node->asm_name ());
+ fprintf (symtab->dump_file, "%s ", node->asm_name ());
}
- fprintf (cgraph_dump_file, "\n Symbols in boundary: ");
+ fprintf (symtab->dump_file, "\n Symbols in boundary: ");
for (lsei = lsei_start (part->encoder); !lsei_end_p (lsei);
lsei_next (&lsei))
{
symtab_node *node = lsei_node (lsei);
if (!lto_symtab_encoder_in_partition_p (part->encoder, node))
{
- fprintf (cgraph_dump_file, "%s ", node->asm_name ());
+ fprintf (symtab->dump_file, "%s ", node->asm_name ());
cgraph_node *cnode = dyn_cast <cgraph_node *> (node);
if (cnode
&& lto_symtab_encoder_encode_body_p (part->encoder, cnode))
- fprintf (cgraph_dump_file, "(body included)");
+ fprintf (symtab->dump_file, "(body included)");
else
{
varpool_node *vnode = dyn_cast <varpool_node *> (node);
if (vnode
&& lto_symtab_encoder_encode_initializer_p (part->encoder, vnode))
- fprintf (cgraph_dump_file, "(initializer included)");
+ fprintf (symtab->dump_file, "(initializer included)");
}
}
}
- fprintf (cgraph_dump_file, "\n");
+ fprintf (symtab->dump_file, "\n");
}
gcc_checking_assert (lto_symtab_encoder_size (part->encoder) || !i);
@@ -2889,7 +2890,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
struct lto_file_decl_data **decl_data;
symtab_node *snode;
- init_cgraph ();
+ symtab->initialize ();
timevar_push (TV_IPA_LTO_DECL_IN);
@@ -2914,7 +2915,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
/* True, since the plugin splits the archives. */
gcc_assert (num_objects == nfiles);
}
- cgraph_state = CGRAPH_LTO_STREAMING;
+ symtab->state = LTO_STREAMING;
canonical_type_hash_cache = new hash_map<const_tree, hashval_t> (251);
gimple_canonical_types = htab_create_ggc (16381, gimple_canonical_type_hash,
@@ -3078,23 +3079,23 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
/* Finally merge the cgraph according to the decl merging decisions. */
timevar_push (TV_IPA_LTO_CGRAPH_MERGE);
- if (cgraph_dump_file)
+ if (symtab->dump_file)
{
- fprintf (cgraph_dump_file, "Before merging:\n");
- symtab_node::dump_table (cgraph_dump_file);
+ fprintf (symtab->dump_file, "Before merging:\n");
+ symtab_node::dump_table (symtab->dump_file);
}
lto_symtab_merge_symbols ();
/* Removal of unreachable symbols is needed to make verify_symtab to pass;
we are still having duplicated comdat groups containing local statics.
We could also just remove them while merging. */
- symtab_remove_unreachable_nodes (true, dump_file);
+ symtab->remove_unreachable_nodes (true, dump_file);
ggc_collect ();
- cgraph_state = CGRAPH_STATE_IPA_SSA;
+ symtab->state = IPA_SSA;
timevar_pop (TV_IPA_LTO_CGRAPH_MERGE);
/* Indicate that the cgraph is built and ready. */
- cgraph_function_flags_ready = true;
+ symtab->function_flags_ready = true;
ggc_free (all_file_decl_data);
all_file_decl_data = NULL;
@@ -3236,20 +3237,20 @@ do_whole_program_analysis (void)
dump_memory_report (false);
}
- cgraph_function_flags_ready = true;
+ symtab->function_flags_ready = true;
- if (cgraph_dump_file)
- symtab_node::dump_table (cgraph_dump_file);
+ if (symtab->dump_file)
+ symtab_node::dump_table (symtab->dump_file);
bitmap_obstack_initialize (NULL);
- cgraph_state = CGRAPH_STATE_IPA_SSA;
+ symtab->state = IPA_SSA;
execute_ipa_pass_list (g->get_passes ()->all_regular_ipa_passes);
- symtab_remove_unreachable_nodes (false, dump_file);
+ symtab->remove_unreachable_nodes (false, dump_file);
- if (cgraph_dump_file)
+ if (symtab->dump_file)
{
- fprintf (cgraph_dump_file, "Optimized ");
- symtab_node::dump_table (cgraph_dump_file);
+ fprintf (symtab->dump_file, "Optimized ");
+ symtab_node::dump_table (symtab->dump_file);
}
#ifdef ENABLE_CHECKING
symtab_node::verify_symtab_nodes ();
@@ -3432,7 +3433,7 @@ lto_main (void)
/* Let the middle end know that we have read and merged all of
the input files. */
- compile ();
+ symtab->compile ();
timevar_stop (TV_PHASE_OPT_GEN);