aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-05-12 23:32:59 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-05-12 21:32:59 +0000
commit5f902d766c18beade9fd700b53a83d4e57622b10 (patch)
treed7aef00d4cbf971dd328d8e3e60c9fd6278373a2 /gcc/cgraph.c
parent87a0ebfd203382a034b76c3a087d310908005454 (diff)
downloadgcc-5f902d766c18beade9fd700b53a83d4e57622b10.zip
gcc-5f902d766c18beade9fd700b53a83d4e57622b10.tar.gz
gcc-5f902d766c18beade9fd700b53a83d4e57622b10.tar.bz2
cgraphbuild.c (build_cgraph_edges, [...]): Build indrect edges too.
* cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges): Build indrect edges too. * cgraph.c (cgraph_create_indirect_edge): Take ecf_flags argument. (cgraph_clone_edge): Update. (cgraph_node_remove_callees): Remove indirect calls too. * cgraph.h (cgraph_indirect_call_info): Add ecf_flags. (cgraph_create_indirect_edge): Update prototype. * ipa-reference.c (has_proper_scope_for_analysis): Rename to is_proper_for_analysis. (add_new_function, visited_nodes, function_insertion_hook_holder, get_local_reference_vars_info, mark_address_taken, mark_address, mark_load, mark_store, check_asm_memory_clobber, check_call, scan_stmt_for_static_refs, scan_initializer_for_static_refs): Remove. (ipa_init): Do not initialize visited_nodes; function_insertion_hook_holder. (analyze_variable): Rewrite. (analyze_function): Rewrite. (copy_local_bitmap): Remove. (duplicate_node_dat): Do not duplicate local info. (generate_summary): Simplify to only walk cgraph. (write_node_summary_p, ipa_reference_write_summary, ipa_reference_read_summary): Remove. (propagate): Do not remove function insertion; generate summary. (pass_ipa_reference): NULLify summary handling fields. * lto-cgraph.c (lto_output_edge): Output ecf_flags. (input_edge): Input ecf_flags. * ipa-prop.c (ipa_note_parm_call): Expect edge to be around. (update_indirect_edges_after_inlining): Ignore edges with unknown param. From-SVN: r159343
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 60effb0..b16a10d 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1036,6 +1036,7 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
struct cgraph_edge *
cgraph_create_indirect_edge (struct cgraph_node *caller, gimple call_stmt,
+ int ecf_flags,
gcov_type count, int freq, int nest)
{
struct cgraph_edge *edge = cgraph_create_edge_1 (caller, NULL, call_stmt,
@@ -1046,6 +1047,7 @@ cgraph_create_indirect_edge (struct cgraph_node *caller, gimple call_stmt,
edge->indirect_info = GGC_NEW (struct cgraph_indirect_call_info);
edge->indirect_info->param_index = -1;
+ edge->indirect_info->ecf_flags = ecf_flags;
edge->next_callee = caller->indirect_calls;
if (caller->indirect_calls)
@@ -1292,6 +1294,15 @@ cgraph_node_remove_callees (struct cgraph_node *node)
cgraph_edge_remove_callee (e);
cgraph_free_edge (e);
}
+ for (e = node->indirect_calls; e; e = f)
+ {
+ f = e->next_callee;
+ cgraph_call_edge_removal_hooks (e);
+ if (!e->indirect_unknown_callee)
+ cgraph_edge_remove_callee (e);
+ cgraph_free_edge (e);
+ }
+ node->indirect_calls = NULL;
node->callees = NULL;
if (node->call_site_hash)
{
@@ -2009,7 +2020,9 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
}
else
{
- new_edge = cgraph_create_indirect_edge (n, call_stmt, count, freq,
+ new_edge = cgraph_create_indirect_edge (n, call_stmt,
+ e->indirect_info->ecf_flags,
+ count, freq,
e->loop_nest + loop_nest);
new_edge->indirect_info->param_index = e->indirect_info->param_index;
}