aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2013-10-15 16:15:07 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2013-10-15 16:15:07 +0200
commit4cb1359729c72f65a8b6da12af6baab74082dd3f (patch)
tree034042b55baa73cd22e73f36b314087fb4581427 /gcc/ipa-utils.c
parent2e2206faab182f079bc6d6019f7872820d830bee (diff)
downloadgcc-4cb1359729c72f65a8b6da12af6baab74082dd3f.zip
gcc-4cb1359729c72f65a8b6da12af6baab74082dd3f.tar.gz
gcc-4cb1359729c72f65a8b6da12af6baab74082dd3f.tar.bz2
ipa-utils.h (ipa_edge_within_scc): Declare.
2013-10-15 Martin Jambor <mjambor@suse.cz> * ipa-utils.h (ipa_edge_within_scc): Declare. * ipa-cp.c (edge_within_scc): Moved... * ipa-utils.c (ipa_edge_within_scc): ...here. Updated all callers. From-SVN: r203607
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;