aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphbuild.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-05-11 08:14:50 +0000
committerJan Hubicka <jh@suse.cz>2010-05-11 08:14:50 +0000
commit49b8fc04e45649fc4556b656c2d45983a0f49d4c (patch)
tree42568770dccb09df07e5beff55df5ce77b3c4957 /gcc/cgraphbuild.c
parent428d118aaddff9bdc17dae637f48a93d511dcf51 (diff)
* cgraphbuild.c (cgraph_rebuild_references): New.
(cgraph_mark_reachable_node): Accept references to optimized out extern inlines. * cgraph.h (cgraph_rebuild_references): Declare. * tree-inline.c (tree_function_versioning): Use it. * ipa-struct-reorg.c (do_reorg_for_func): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@159259 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphbuild.c')
-rw-r--r--gcc/cgraphbuild.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 246be20df2e..b09963d1c04 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -463,6 +463,37 @@ rebuild_cgraph_edges (void)
return 0;
}
+/* Rebuild cgraph edges for current function node. This needs to be run after
+ passes that don't update the cgraph. */
+
+void
+cgraph_rebuild_references (void)
+{
+ basic_block bb;
+ struct cgraph_node *node = cgraph_node (current_function_decl);
+ gimple_stmt_iterator gsi;
+
+ ipa_remove_all_references (&node->ref_list);
+
+ node->count = ENTRY_BLOCK_PTR->count;
+
+ FOR_EACH_BB (bb)
+ {
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+
+ walk_stmt_load_store_addr_ops (stmt, node, mark_load,
+ mark_store, mark_address);
+
+ }
+ for (gsi = gsi_start (phi_nodes (bb)); !gsi_end_p (gsi); gsi_next (&gsi))
+ walk_stmt_load_store_addr_ops (gsi_stmt (gsi), node,
+ mark_load, mark_store, mark_address);
+ }
+ record_eh_tables (node, cfun);
+}
+
struct gimple_opt_pass pass_rebuild_cgraph_edges =
{
{