diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-06 16:59:49 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-06 16:59:49 +0000 |
commit | eaad46f21fa13f39002387b880ab046f0be72343 (patch) | |
tree | e06c2e69d4ad72b54dff08acfb5ac74d389b8f74 /gcc/lto | |
parent | 66b3edb83f7a5f6d555be6c3f33041984de767c1 (diff) | |
download | gcc-eaad46f21fa13f39002387b880ab046f0be72343.tar.gz |
* cgraph.c (cgraph_get_body): New function based on lto.c
implementation.
* cgraph.h (cgraph_get_body): Declare.
* cgraphclones.c (cgraph_create_virtual_clone): Commonize WPA and LTO paths.
* cgraphunit.c (expand_function): Get body prior expanding.
* ipa.c (function_and_variable_visibility): Use gimple_has_body_p test.
* lto-cgraph.c (lto_output_node): Do not stream bodies we don't really need.
* passes.c (do_per_function_toporder): Get body.
* tree-inline.c (expand_call_inline): Get body prior inlining it.
* tree-ssa-structalias.c (ipa_pta_execute): Get body; skip clones.
* lto.c (lto_materialize_function): Do not read body anymore.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201537 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/lto/lto.c | 35 |
2 files changed, 7 insertions, 32 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 33f3b321d81..cb10a4bf8c8 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,7 @@ +2013-08-06 Jan Hubicka <jh@suse.cz> + + * lto.c (lto_materialize_function): Do not read body anymore. + 2013-08-02 Jan Hubicka <jh@suse.cz> * lto.c (lto_materialize_function): Do not push struct function. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 42d67f1bd3d..c854589c673 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -192,48 +192,19 @@ static void lto_materialize_function (struct cgraph_node *node) { tree decl; - struct lto_file_decl_data *file_data; - const char *data, *name; - size_t len; decl = node->symbol.decl; /* Read in functions with body (analyzed nodes) and also functions that are needed to produce virtual clones. */ if ((cgraph_function_with_gimple_body_p (node) && node->symbol.analyzed) + || node->used_as_abstract_origin || has_analyzed_clone_p (node)) { /* Clones don't need to be read. */ if (node->clone_of) return; - - /* Load the function body only if not operating in WPA mode. In - WPA mode, the body of the function is not needed. */ - if (!flag_wpa) - { - file_data = node->symbol.lto_file_data; - name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - - /* We may have renamed the declaration, e.g., a static function. */ - name = lto_get_decl_name_mapping (file_data, name); - - data = lto_get_section_data (file_data, LTO_section_function_body, - name, &len); - if (!data) - fatal_error ("%s: section %s is missing", - file_data->file_name, - name); - - gcc_assert (DECL_STRUCT_FUNCTION (decl) == NULL); - - announce_function (decl); - lto_input_function_body (file_data, decl, data); - if (DECL_FUNCTION_PERSONALITY (decl) && !first_personality_decl) - first_personality_decl = DECL_FUNCTION_PERSONALITY (decl); - lto_stats.num_function_bodies++; - lto_free_section_data (file_data, LTO_section_function_body, name, - data, len); - ggc_collect (); - } + if (DECL_FUNCTION_PERSONALITY (decl) && !first_personality_decl) + first_personality_decl = DECL_FUNCTION_PERSONALITY (decl); } /* Let the middle end know about the function. */ |