aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2011-04-27 14:13:08 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2011-04-27 12:13:08 +0000
commit40982661ecee5596098183627a9f1db6cf78c03b (patch)
tree85779eb84644db79d692e5e5c0ef1ba413ee42f2 /gcc/ipa-prop.c
parent7a735dd4e4b7f5baffe8d64b373c2982d3d1f59a (diff)
downloadgcc-40982661ecee5596098183627a9f1db6cf78c03b.zip
gcc-40982661ecee5596098183627a9f1db6cf78c03b.tar.gz
gcc-40982661ecee5596098183627a9f1db6cf78c03b.tar.bz2
ipa-prop.c (function_insertion_hook_holder): New holder.
* ipa-prop.c (function_insertion_hook_holder): New holder. (ipa_add_new_function): New function. (ipa_register_cgraph_hooks, ipa_unregister_cgraph_hooks): Register/deregister holder. From-SVN: r173026
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 5691193..73203a38 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -63,6 +63,7 @@ static struct cgraph_edge_hook_list *edge_removal_hook_holder;
static struct cgraph_node_hook_list *node_removal_hook_holder;
static struct cgraph_2edge_hook_list *edge_duplication_hook_holder;
static struct cgraph_2node_hook_list *node_duplication_hook_holder;
+static struct cgraph_node_hook_list *function_insertion_hook_holder;
/* Add cgraph NODE described by INFO to the worklist WL regardless of whether
it is in one or not. It should almost never be used directly, as opposed to
@@ -2058,6 +2059,15 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
new_info->node_enqueued = old_info->node_enqueued;
}
+
+/* Analyze newly added function into callgraph. */
+
+static void
+ipa_add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
+{
+ ipa_analyze_node (node);
+}
+
/* Register our cgraph hooks if they are not already there. */
void
@@ -2075,6 +2085,8 @@ ipa_register_cgraph_hooks (void)
if (!node_duplication_hook_holder)
node_duplication_hook_holder =
cgraph_add_node_duplication_hook (&ipa_node_duplication_hook, NULL);
+ function_insertion_hook_holder =
+ cgraph_add_function_insertion_hook (&ipa_add_new_function, NULL);
}
/* Unregister our cgraph hooks if they are not already there. */
@@ -2090,6 +2102,8 @@ ipa_unregister_cgraph_hooks (void)
edge_duplication_hook_holder = NULL;
cgraph_remove_node_duplication_hook (node_duplication_hook_holder);
node_duplication_hook_holder = NULL;
+ cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
+ function_insertion_hook_holder = NULL;
}
/* Allocate all necessary data structures necessary for indirect inlining. */