aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2014-10-07 09:18:37 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-10-07 09:18:37 +0000
commit8ccda8bce69d8e511e38689fb75b7f5a404e00c3 (patch)
tree72fe163acf91a73fc92b843156c63ac32b67292f /gcc/cgraph.c
parent2f77200b3f168ebf0b07acd63d68096d8840fc1d (diff)
downloadgcc-8ccda8bce69d8e511e38689fb75b7f5a404e00c3.zip
gcc-8ccda8bce69d8e511e38689fb75b7f5a404e00c3.tar.gz
gcc-8ccda8bce69d8e511e38689fb75b7f5a404e00c3.tar.bz2
cgraph.h (cgraph_node::get_fun): Declare.
* cgraph.h (cgraph_node::get_fun): Declare. * cgraph.c (cgraph_node::get_fun): New method. * ipa-inline.c (can_inline_edge_p): Use it. From-SVN: r215968
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 38dc7e6..f842b1b 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2992,6 +2992,23 @@ cgraph_node::get_body (void)
return true;
}
+/* Return the DECL_STRUCT_FUNCTION of the function. */
+
+struct function *
+cgraph_node::get_fun (void)
+{
+ cgraph_node *node = this;
+ struct function *fun = DECL_STRUCT_FUNCTION (node->decl);
+
+ while (!fun && node->clone_of)
+ {
+ node = node->clone_of;
+ fun = DECL_STRUCT_FUNCTION (node->decl);
+ }
+
+ return fun;
+}
+
/* Verify if the type of the argument matches that of the function
declaration. If we cannot verify this or there is a mismatch,
return false. */