aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-utils.c')
-rw-r--r--gcc/ipa-utils.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c
index b59be8c..5802884 100644
--- a/gcc/ipa-utils.c
+++ b/gcc/ipa-utils.c
@@ -253,6 +253,22 @@ ipa_get_nodes_in_cycle (struct cgraph_node *node)
return v;
}
+/* Return true iff the CS is an edge within a strongly connected component as
+ computed by ipa_reduced_postorder. */
+
+bool
+ipa_edge_within_scc (struct cgraph_edge *cs)
+{
+ struct ipa_dfs_info *caller_dfs = (struct ipa_dfs_info *) cs->caller->symbol.aux;
+ struct ipa_dfs_info *callee_dfs;
+ struct cgraph_node *callee = cgraph_function_node (cs->callee, NULL);
+
+ callee_dfs = (struct ipa_dfs_info *) callee->symbol.aux;
+ return (caller_dfs
+ && callee_dfs
+ && caller_dfs->scc_no == callee_dfs->scc_no);
+}
+
struct postorder_stack
{
struct cgraph_node *node;