summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-in.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-08 12:55:31 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-08 12:55:31 +0000
commit472ca566f917ce9aadb3950b5e65cc212fcbbb0b (patch)
tree37a2deb9dfd8703ab2605b7c559b3f67621fb4ff /gcc/lto-streamer-in.c
parent89e0402e778b709efcc6476762d27b412fd5ae3f (diff)
downloadgcc-472ca566f917ce9aadb3950b5e65cc212fcbbb0b.tar.gz
2014-08-08 Richard Biener <rguenther@suse.de>
* lto-streamer.h (struct lto_input_block): Make it a class with a constructor. (LTO_INIT_INPUT_BLOCK, LTO_INIT_INPUT_BLOCK_PTR): Remove. (struct lto_function_header, struct lto_simple_header, struct lto_simple_header_with_strings, struct lto_decl_header, struct lto_function_header): Make a simple inheritance hieararchy. Remove unused fields. (struct lto_asm_header): Remove. * lto-streamer-out.c (produce_asm): Adjust. (lto_output_toplevel_asms): Likewise. (produce_asm_for_decls): Likewise. * lto-section-out.c (lto_destroy_simple_output_block): Likewise. * data-streamer-in.c (string_for_index): Likewise. * ipa-inline-analysis.c (inline_read_section): Likewise. * ipa-prop.c (ipa_prop_read_section): Likewise. (read_replacements_section): Likewise. * lto-cgraph.c (input_cgraph_opt_section): Likewise. * lto-section-in.c (lto_create_simple_input_block): Likewise. (lto_destroy_simple_input_block): Likewise. * lto-streamer-in.c (lto_read_body_or_constructor): Likewise. (lto_input_toplevel_asms): Likewise. lto/ * lto.c (lto_read_decls): Adjust for lto_input_block changes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213759 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r--gcc/lto-streamer-in.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 9b95970824e..391115778b9 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -1054,8 +1054,6 @@ lto_read_body_or_constructor (struct lto_file_decl_data *file_data, struct symta
int cfg_offset;
int main_offset;
int string_offset;
- struct lto_input_block ib_cfg;
- struct lto_input_block ib_main;
tree fn_decl = node->decl;
header = (const struct lto_function_header *) data;
@@ -1064,26 +1062,11 @@ lto_read_body_or_constructor (struct lto_file_decl_data *file_data, struct symta
cfg_offset = sizeof (struct lto_function_header);
main_offset = cfg_offset + header->cfg_size;
string_offset = main_offset + header->main_size;
-
- LTO_INIT_INPUT_BLOCK (ib_cfg,
- data + cfg_offset,
- 0,
- header->cfg_size);
-
- LTO_INIT_INPUT_BLOCK (ib_main,
- data + main_offset,
- 0,
- header->main_size);
}
else
{
main_offset = sizeof (struct lto_function_header);
string_offset = main_offset + header->main_size;
-
- LTO_INIT_INPUT_BLOCK (ib_main,
- data + main_offset,
- 0,
- header->main_size);
}
data_in = lto_data_in_create (file_data, data + string_offset,
@@ -1104,8 +1087,12 @@ lto_read_body_or_constructor (struct lto_file_decl_data *file_data, struct symta
/* Set up the struct function. */
from = data_in->reader_cache->nodes.length ();
+ lto_input_block ib_main (data + main_offset, header->main_size);
if (TREE_CODE (node->decl) == FUNCTION_DECL)
- input_function (fn_decl, data_in, &ib_main, &ib_cfg);
+ {
+ lto_input_block ib_cfg (data + cfg_offset, header->cfg_size);
+ input_function (fn_decl, data_in, &ib_main, &ib_cfg);
+ }
else
input_constructor (fn_decl, data_in, &ib_main);
/* And fixup types we streamed locally. */
@@ -1357,10 +1344,10 @@ lto_input_toplevel_asms (struct lto_file_decl_data *file_data, int order_base)
size_t len;
const char *data = lto_get_section_data (file_data, LTO_section_asm,
NULL, &len);
- const struct lto_asm_header *header = (const struct lto_asm_header *) data;
+ const struct lto_simple_header_with_strings *header
+ = (const struct lto_simple_header_with_strings *) data;
int string_offset;
struct data_in *data_in;
- struct lto_input_block ib;
tree str;
if (! data)
@@ -1368,10 +1355,7 @@ lto_input_toplevel_asms (struct lto_file_decl_data *file_data, int order_base)
string_offset = sizeof (*header) + header->main_size;
- LTO_INIT_INPUT_BLOCK (ib,
- data + sizeof (*header),
- 0,
- header->main_size);
+ lto_input_block ib (data + sizeof (*header), header->main_size);
data_in = lto_data_in_create (file_data, data + string_offset,
header->string_size, vNULL);