From 85ad2ef57fb2c016b0944e2d685e0c57a8018671 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Fri, 29 Apr 2011 00:49:46 +0200 Subject: [PATCH] cgraphunit.c (cgraph_preserve_function_body_p): Accept a cgraph node instead of a decl. 2011-04-29 Martin Jambor * cgraphunit.c (cgraph_preserve_function_body_p): Accept a cgraph node instead of a decl. Update all callers. * cgraph.h: Update declaration. From-SVN: r173138 --- gcc/ChangeLog | 6 ++++++ gcc/cgraph.h | 2 +- gcc/cgraphunit.c | 9 ++++----- gcc/ipa-inline-transform.c | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 459923e4686..204cd0b2037 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-04-29 Martin Jambor + + * cgraphunit.c (cgraph_preserve_function_body_p): Accept a cgraph + node instead of a decl. Update all callers. + * cgraph.h: Update declaration. + 2011-04-28 Ira Rosen PR tree-optimization/48765 diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 14848b5e6b9..ec95ba7c430 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -573,7 +573,7 @@ void cgraph_mark_needed_node (struct cgraph_node *); void cgraph_mark_address_taken_node (struct cgraph_node *); void cgraph_mark_reachable_node (struct cgraph_node *); bool cgraph_inline_p (struct cgraph_edge *, cgraph_inline_failed_t *reason); -bool cgraph_preserve_function_body_p (tree); +bool cgraph_preserve_function_body_p (struct cgraph_node *); void verify_cgraph (void); void verify_cgraph_node (struct cgraph_node *); void cgraph_build_static_cdtor (char which, tree body, int priority); diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index aa2f2a1e7df..70b63b33b91 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1580,7 +1580,7 @@ cgraph_expand_function (struct cgraph_node *node) /* Make sure that BE didn't give up on compiling. */ gcc_assert (TREE_ASM_WRITTEN (decl)); current_function_decl = NULL; - gcc_assert (!cgraph_preserve_function_body_p (decl)); + gcc_assert (!cgraph_preserve_function_body_p (node)); cgraph_release_function_body (node); /* Eliminate all call edges. This is important so the GIMPLE_CALL no longer points to the dead function body. */ @@ -1758,13 +1758,12 @@ cgraph_output_in_order (void) /* Return true when function body of DECL still needs to be kept around for later re-use. */ bool -cgraph_preserve_function_body_p (tree decl) +cgraph_preserve_function_body_p (struct cgraph_node *node) { - struct cgraph_node *node; - gcc_assert (cgraph_global_info_ready); + gcc_assert (!node->same_body_alias); + /* Look if there is any clone around. */ - node = cgraph_get_node (decl); if (node->clones) return true; return false; diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c index 7465325a35b..117958ccf03 100644 --- a/gcc/ipa-inline-transform.c +++ b/gcc/ipa-inline-transform.c @@ -297,7 +297,7 @@ inline_transform (struct cgraph_node *node) /* We might need the body of this function so that we can expand it inline somewhere else. */ - if (cgraph_preserve_function_body_p (node->decl)) + if (cgraph_preserve_function_body_p (node)) save_inline_function_body (node); for (e = node->callees; e; e = e->next_callee) -- 2.30.2