aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.c
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/ipa-utils.c
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/ipa-utils.c')
-rw-r--r--gcc/ipa-utils.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c
index 590ac27..552071e 100644
--- a/gcc/ipa-utils.c
+++ b/gcc/ipa-utils.c
@@ -173,7 +173,7 @@ ipa_reduced_postorder (struct cgraph_node **order,
struct cgraph_node *node;
struct searchc_env env;
splay_tree_node result;
- env.stack = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
+ env.stack = XCNEWVEC (struct cgraph_node *, symtab->cgraph_count);
env.stack_size = 0;
env.result = order;
env.order_pos = 0;
@@ -292,7 +292,7 @@ ipa_reverse_postorder (struct cgraph_node **order)
struct ipa_ref *ref = NULL;
struct postorder_stack *stack =
- XCNEWVEC (struct postorder_stack, cgraph_n_nodes);
+ XCNEWVEC (struct postorder_stack, symtab->cgraph_count);
/* We have to deal with cycles nicely, so use a depth first traversal
output algorithm. Ignore the fact that some functions won't need
@@ -407,9 +407,9 @@ ipa_merge_profiles (struct cgraph_node *dst,
if (!dst->count)
return;
- if (cgraph_dump_file)
+ if (symtab->dump_file)
{
- fprintf (cgraph_dump_file, "Merging profiles of %s/%i to %s/%i\n",
+ fprintf (symtab->dump_file, "Merging profiles of %s/%i to %s/%i\n",
xstrdup (src->name ()), src->order,
xstrdup (dst->name ()), dst->order);
}
@@ -456,16 +456,16 @@ ipa_merge_profiles (struct cgraph_node *dst,
if (n_basic_blocks_for_fn (srccfun)
!= n_basic_blocks_for_fn (dstcfun))
{
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
"Giving up; number of basic block mismatch.\n");
match = false;
}
else if (last_basic_block_for_fn (srccfun)
!= last_basic_block_for_fn (dstcfun))
{
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
"Giving up; last block mismatch.\n");
match = false;
}
@@ -480,8 +480,8 @@ ipa_merge_profiles (struct cgraph_node *dst,
dstbb = BASIC_BLOCK_FOR_FN (dstcfun, srcbb->index);
if (dstbb == NULL)
{
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
"No matching block for bb %i.\n",
srcbb->index);
match = false;
@@ -489,8 +489,8 @@ ipa_merge_profiles (struct cgraph_node *dst,
}
if (EDGE_COUNT (srcbb->succs) != EDGE_COUNT (dstbb->succs))
{
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
"Edge count mistmatch for bb %i.\n",
srcbb->index);
match = false;
@@ -502,8 +502,8 @@ ipa_merge_profiles (struct cgraph_node *dst,
edge dste = EDGE_SUCC (dstbb, i);
if (srce->dest->index != dste->dest->index)
{
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file,
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file,
"Succ edge mistmatch for bb %i.\n",
srce->dest->index);
match = false;