summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-13 02:13:15 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-13 02:13:15 +0000
commit3afbcf4cd22c81332431b9d387b1ef616310a5fe (patch)
tree53aa432f12e511d7d5bf93c922661e1f9b2417ec /gcc/lto-streamer-out.c
parent6cbd82a69bcb08f4fc4f7ab478101809dd1b9268 (diff)
downloadgcc-3afbcf4cd22c81332431b9d387b1ef616310a5fe.tar.gz
* cgraph.c (cgraph_node::get_untransformed_body): Pass compressed
flag to lto_get_section_data. * varpool.c (varpool_node::get_constructor): Likewise. * lto-section-in.c (lto_get_section_data): Add new flag decompress. (lto_free_section_data): Likewise. (lto_get_raw_section_data): New function. (lto_free_raw_section_data): New function. (copy_function_or_variable): Copy sections w/o decompressing. (lto_output_decl_state_refs): Picke compressed bit. * lto-streamer.h (lto_in_decl_state): New flag compressed. (lto_out_decl_state): Likewise. (lto_get_section_data, lto_free_section_data): Update prototypes (lto_get_raw_section_data, lto_free_raw_section_data): Declare. (lto_write_raw_data): Declare. (lto_begin_section): Remove FIXME. (lto_write_raw_data): New function. (lto_write_stream): Remove FIXME. (lto_new_out_decl_state): Set compressed flag. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231594 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 5524f84dc06..049313dd1bd 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -2191,22 +2191,23 @@ copy_function_or_variable (struct symtab_node *node)
struct lto_in_decl_state *in_state;
struct lto_out_decl_state *out_state = lto_get_out_decl_state ();
- lto_begin_section (section_name, !flag_wpa);
+ lto_begin_section (section_name, false);
free (section_name);
/* 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);
+ data = lto_get_raw_section_data (file_data, LTO_section_function_body,
+ name, &len);
gcc_assert (data);
/* Do a bit copy of the function body. */
- lto_write_data (data, len);
+ lto_write_raw_data (data, len);
/* Copy decls. */
in_state =
lto_get_function_in_decl_state (node->lto_file_data, function);
+ out_state->compressed = in_state->compressed;
gcc_assert (in_state);
for (i = 0; i < LTO_N_DECL_STREAMS; i++)
@@ -2224,8 +2225,8 @@ copy_function_or_variable (struct symtab_node *node)
encoder->trees.safe_push ((*trees)[j]);
}
- lto_free_section_data (file_data, LTO_section_function_body, name,
- data, len);
+ lto_free_raw_section_data (file_data, LTO_section_function_body, name,
+ data, len);
lto_end_section ();
}
@@ -2431,6 +2432,7 @@ lto_output_decl_state_refs (struct output_block *ob,
decl = (state->fn_decl) ? state->fn_decl : void_type_node;
streamer_tree_cache_lookup (ob->writer_cache, decl, &ref);
gcc_assert (ref != (unsigned)-1);
+ ref = ref * 2 + (state->compressed ? 1 : 0);
lto_write_data (&ref, sizeof (uint32_t));
for (i = 0; i < LTO_N_DECL_STREAMS; i++)