aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-section-out.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@gcc.gnu.org>2015-12-13 02:13:15 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2015-12-13 02:13:15 +0000
commit7fa658c2ccdcb482c5060a5cff71b416ae876dbf (patch)
tree53aa432f12e511d7d5bf93c922661e1f9b2417ec /gcc/lto-section-out.c
parentca83487662329ae9130ffbf72fae7dbfe4fddb83 (diff)
downloadgcc-7fa658c2ccdcb482c5060a5cff71b416ae876dbf.zip
gcc-7fa658c2ccdcb482c5060a5cff71b416ae876dbf.tar.gz
gcc-7fa658c2ccdcb482c5060a5cff71b416ae876dbf.tar.bz2
cgraph.c (cgraph_node::get_untransformed_body): Pass compressed flag to lto_get_section_data.
* 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. From-SVN: r231594
Diffstat (limited to 'gcc/lto-section-out.c')
-rw-r--r--gcc/lto-section-out.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/lto-section-out.c b/gcc/lto-section-out.c
index 56b460b..f547cc3 100644
--- a/gcc/lto-section-out.c
+++ b/gcc/lto-section-out.c
@@ -66,9 +66,6 @@ lto_begin_section (const char *name, bool compress)
{
lang_hooks.lto.begin_section (name);
- /* FIXME lto: for now, suppress compression if the lang_hook that appends
- data is anything other than assembler output. The effect here is that
- we get compression of IL only in non-ltrans object files. */
gcc_assert (compression_stream == NULL);
if (compress)
compression_stream = lto_start_compression (lto_append_data, NULL);
@@ -99,6 +96,14 @@ lto_write_data (const void *data, unsigned int size)
lang_hooks.lto.append_data ((const char *)data, size, NULL);
}
+/* Write SIZE bytes starting at DATA to the assembler. */
+
+void
+lto_write_raw_data (const void *data, unsigned int size)
+{
+ lang_hooks.lto.append_data ((const char *)data, size, NULL);
+}
+
/* Write all of the chars in OBS to the assembler. Recycle the blocks
in obs as this is being done. */
@@ -123,10 +128,6 @@ lto_write_stream (struct lto_output_stream *obs)
if (!next_block)
num_chars -= obs->left_in_block;
- /* FIXME lto: WPA mode uses an ELF function as a lang_hook to append
- output data. This hook is not happy with the way that compression
- blocks up output differently to the way it's blocked here. So for
- now, we don't compress WPA output. */
if (compression_stream)
lto_compress_block (compression_stream, base, num_chars);
else
@@ -295,6 +296,9 @@ lto_new_out_decl_state (void)
for (i = 0; i < LTO_N_DECL_STREAMS; i++)
lto_init_tree_ref_encoder (&state->streams[i]);
+ /* At WPA time we do not compress sections by default. */
+ state->compressed = !flag_wpa;
+
return state;
}