summaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-15 14:15:07 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-15 14:15:07 +0000
commita0255a708162aeda3721d91702aaa1e1bd2d3730 (patch)
tree034042b55baa73cd22e73f36b314087fb4581427 /gcc/ipa-utils.c
parent8e9989b0b3cf04f410346deded203dda1f92857a (diff)
downloadgcc-a0255a708162aeda3721d91702aaa1e1bd2d3730.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203607 138bc75d-0d04-0410-961f-82ee72b054a4
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 b59be8c6392..5802884afdf 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;