diff options
author | Jan Hubicka <jh@suse.cz> | 2009-03-28 12:08:16 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2009-03-28 11:08:16 +0000 |
commit | 61a05df17ccd6fd0801571dae07309ca5236d9ec (patch) | |
tree | 0557e52d0af921b06b93448b142c8e6390a24930 /gcc/cgraph.h | |
parent | 144e8aac3db919da759194f93628b91377afc4eb (diff) | |
download | gcc-61a05df17ccd6fd0801571dae07309ca5236d9ec.tar.gz |
Bring from lto-branch:
2008-09-03 Doug Kwan <dougkwan@google.com>
* 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
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 7f2cc7a0d4f..d2d310aa29f 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -189,6 +189,13 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) tree inline_decl; }; +#define DEFCIFCODE(code, string) CIF_ ## code, +/* Reasons for inlining failures. */ +typedef enum { +#include "cif-code.def" + CIF_N_REASONS +} cgraph_inline_failed_t; + struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) { struct cgraph_node *caller; @@ -199,9 +206,9 @@ struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_call struct cgraph_edge *next_callee; gimple call_stmt; PTR GTY ((skip (""))) aux; - /* When NULL, inline this call. When non-NULL, points to the explanation - why function was not inlined. */ - const char *inline_failed; + /* When equal to CIF_OK, inline this call. Otherwise, points to the + explanation why function was not inlined. */ + cgraph_inline_failed_t inline_failed; /* Expected number of executions: calculated in profile.c. */ gcov_type count; /* Expected frequency of executions within the function. @@ -332,6 +339,7 @@ void cgraph_unnest_node (struct cgraph_node *); enum availability cgraph_function_body_availability (struct cgraph_node *); void cgraph_add_new_function (tree, bool); +const char* cgraph_inline_failed_string (cgraph_inline_failed_t); /* In cgraphunit.c */ void cgraph_finalize_function (tree, bool); @@ -340,7 +348,7 @@ void cgraph_finalize_compilation_unit (void); void cgraph_optimize (void); void cgraph_mark_needed_node (struct cgraph_node *); void cgraph_mark_reachable_node (struct cgraph_node *); -bool cgraph_inline_p (struct cgraph_edge *, const char **reason); +bool cgraph_inline_p (struct cgraph_edge *, cgraph_inline_failed_t *reason); bool cgraph_preserve_function_body_p (tree); void verify_cgraph (void); void verify_cgraph_node (struct cgraph_node *); @@ -449,7 +457,6 @@ varpool_next_static_initializer (struct varpool_node *node) /* In ipa-inline.c */ void cgraph_clone_inlined_nodes (struct cgraph_edge *, bool, bool); -bool cgraph_default_inline_p (struct cgraph_node *, const char **); unsigned int compute_inline_parameters (struct cgraph_node *); |