From b12b920e1e57309423ba7563820dcf4501297512 Mon Sep 17 00:00:00 2001 From: hubicka Date: Mon, 9 Mar 2015 04:53:54 +0000 Subject: * ipa-inline-analysis.c (check_callers): Check node->can_remove_if_no_direct_calls_and_refs_p. (growth_likely_positive): Reorganize to call can_remove_if_no_direct_calls_p later. * cgraph.h (will_be_removed_from_program_if_no_direct_calls_p, will_be_removed_from_program_if_no_direct_calls_p): Add will_inline parameter. * cgraph.c (cgraph_node::can_remove_if_no_direct_calls_p, cgraph_node::will_be_removed_from_program_if_no_direct_calls_p): Handle inliner case correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221277 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cgraph.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gcc/cgraph.h') diff --git a/gcc/cgraph.h b/gcc/cgraph.h index dcf383bf35a..2b96b6bcd06 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -1110,16 +1110,23 @@ public: all uses of COMDAT function does not make it necessarily disappear from the program unless we are compiling whole program or we do LTO. In this case we know we win since dynamic linking will not really discard the - linkonce section. */ - bool will_be_removed_from_program_if_no_direct_calls_p (void); + linkonce section. + + If WILL_INLINE is true, assume that function will be inlined into all the + direct calls. */ + bool will_be_removed_from_program_if_no_direct_calls_p + (bool will_inline = false); /* Return true when function can be removed from callgraph - if all direct calls are eliminated. */ + if all direct calls and references are eliminated. The function does + not take into account comdat groups. */ bool can_remove_if_no_direct_calls_and_refs_p (void); /* Return true when function cgraph_node and its aliases can be removed from - callgraph if all direct calls are eliminated. */ - bool can_remove_if_no_direct_calls_p (void); + callgraph if all direct calls are eliminated. + If WILL_INLINE is true, assume that function will be inlined into all the + direct calls. */ + bool can_remove_if_no_direct_calls_p (bool will_inline = false); /* Return true when callgraph node is a function with Gimple body defined in current unit. Functions can also be define externally or they -- cgit v1.2.1