From 4cb1359729c72f65a8b6da12af6baab74082dd3f Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Tue, 15 Oct 2013 16:15:07 +0200 Subject: ipa-utils.h (ipa_edge_within_scc): Declare. 2013-10-15 Martin Jambor * 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 --- gcc/ipa-utils.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gcc/ipa-utils.c') 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; -- cgit v1.1