From 61a05df17ccd6fd0801571dae07309ca5236d9ec Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 28 Mar 2009 12:08:16 +0100 Subject: Bring from lto-branch: 2008-09-03 Doug Kwan * cgraphbuild.c (initialize_inline_failed): Use cgraph_inline_failed_t enums instead of reason strings. * cgraph.c (cgraph_create_edge): Same. (cgraph_inline_failed_string): New function. * cgraph.h (cgraph_inline_failed_t): New enum type. (cgraph_inline_failed_string): New prototype. (struct cgraph_edge): Change type of INLINED_FAILED from constant char pointer to cgraph_inline_failed_t. (cgraph_inline_p): Adjust prototype to use cgraph_inline_failed_t. (cgraph_default_inline_p): Ditto. * gcc/cgraphunit.c (cgraph_inline_p): Change type of parameter REASON to cgraph_inline_failed_t pointer. * cif-code.def: New file. * ipa-inline.c (cgraph_mark_inline_edge): Use an enum instead of a reason string. (cgraph_check_inline_limits): Change type of REASON to pointer to cgraph_inline_failed_t. Replace reason strings with enums. (cgraph_default_inline_p): Ditto. (cgraph_recursive_inlining_p): Ditto. (update_caller_keys): Change type of FAILED_REASON to cgraph_inline_failed_t. (cgraph_set_inline_failed): Change type of REASON to pointer to cgraph_inline_failed_t. Call cgraph_inline_failed_string to convert enums to strings for text output. (cgraph_decide_inlining_of_small_function): Change FAILED_REASON to be of type cgraph_inline_failed_t. Replace reason strings with enums. Call cgraph_inline_failed_string to covert enums to strings for text output. (cgraph_decide_inlining): Replace reason strings with enums. (cgraph_decide_inlining_incrementally): Change type of FAILED_REASON to cgraph_inline_failed_t type. Call cgraph_inline_failed_string for text output. * tree-inline.c (expand_call_inline): Change type of REASON to cgraph_inline_failed_t. Replace reason strings with enums. Call cgraph_inline_failed_string for text output. * Makefile.in (CGRAPH_H): Add cif-code.def to dependencies. (cgraph.o): Ditto. From-SVN: r145176 --- gcc/tree-inline.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gcc/tree-inline.c') diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index e6a2fb3..37d9098 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -3153,7 +3153,7 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) tree modify_dest; location_t saved_location; struct cgraph_edge *cg_edge; - const char *reason; + cgraph_inline_failed_t reason; basic_block return_block; edge e; gimple_stmt_iterator gsi, stmt_gsi; @@ -3218,7 +3218,7 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) cgraph_create_edge (id->dst_node, dest, stmt, bb->count, CGRAPH_FREQ_BASE, bb->loop_depth)->inline_failed - = N_("originally indirect function call not considered for inlining"); + = CIF_ORIGINALLY_INDIRECT_CALL; if (dump_file) { fprintf (dump_file, "Created new direct edge to %s", @@ -3241,18 +3241,19 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) /* Avoid warnings during early inline pass. */ && cgraph_global_info_ready) { - sorry ("inlining failed in call to %q+F: %s", fn, reason); + sorry ("inlining failed in call to %q+F: %s", fn, + cgraph_inline_failed_string (reason)); sorry ("called from here"); } else if (warn_inline && DECL_DECLARED_INLINE_P (fn) && !DECL_IN_SYSTEM_HEADER (fn) - && strlen (reason) + && reason != CIF_UNSPECIFIED && !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn)) /* Avoid warnings during early inline pass. */ && cgraph_global_info_ready) { warning (OPT_Winline, "inlining failed in call to %q+F: %s", - fn, reason); + fn, cgraph_inline_failed_string (reason)); warning (OPT_Winline, "called from here"); } goto egress; -- cgit v1.1