aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Espindola <espindola@google.com>2009-10-01 13:21:49 +0000
committerRafael Espindola <espindola@google.com>2009-10-01 13:21:49 +0000
commit9afa00f6221a3d3b8cad178a12ef698085e9397a (patch)
treebf8b2e09efe6671741457b864aecee48454df35e
parentcb26b3c817bea9bbfda0bcbfda197f2050925b4f (diff)
2009-10-01 Rafael Avila de Espindola <espindola@google.com>
* lto-opts.c (lto_write_options): Update call to lto_begin_section. * lto-section-out.c (lto_begin_section): Add a compress argument. Update all callers. (produce_symtab): Don't compress. * lto-section-out.h (lto_begin_section): Add a compress argument. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@152370 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.lto8
-rw-r--r--gcc/lto-opts.c2
-rw-r--r--gcc/lto-section-out.c9
-rw-r--r--gcc/lto-streamer-out.c8
-rw-r--r--gcc/lto-streamer.h2
5 files changed, 19 insertions, 10 deletions
diff --git a/gcc/ChangeLog.lto b/gcc/ChangeLog.lto
index d8560113243..86625823835 100644
--- a/gcc/ChangeLog.lto
+++ b/gcc/ChangeLog.lto
@@ -1,3 +1,11 @@
+2009-10-01 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-opts.c (lto_write_options): Update call to lto_begin_section.
+ * lto-section-out.c (lto_begin_section): Add a compress argument.
+ Update all callers.
+ (produce_symtab): Don't compress.
+ * lto-section-out.h (lto_begin_section): Add a compress argument.
+
2009-09-30 Richard Guenther <rguenther@suse.de>
PR middle-end/41502
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index 0567cc29800..145ad00b4c1 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -289,7 +289,7 @@ lto_write_options (void)
struct lto_simple_header header;
struct lto_output_stream *header_stream;
- lto_begin_section (section_name);
+ lto_begin_section (section_name, !flag_wpa);
free (section_name);
memset (&stream, 0, sizeof (stream));
diff --git a/gcc/lto-section-out.c b/gcc/lto-section-out.c
index 9b1ae3c99b4..e347027c709 100644
--- a/gcc/lto-section-out.c
+++ b/gcc/lto-section-out.c
@@ -165,10 +165,11 @@ lto_append_data (const char *chars, unsigned int num_chars, void *opaque)
static struct lto_compression_stream *compression_stream = NULL;
-/* Begin a new output section named NAME. */
+/* Begin a new output section named NAME. If COMPRESS is true, zlib compress
+ the section. */
void
-lto_begin_section (const char *name)
+lto_begin_section (const char *name, bool compress)
{
lang_hooks.lto.begin_section (name);
@@ -176,7 +177,7 @@ lto_begin_section (const char *name)
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 (!flag_wpa)
+ if (compress)
compression_stream = lto_start_compression (lto_append_data, NULL);
}
@@ -529,7 +530,7 @@ lto_destroy_simple_output_block (struct lto_simple_output_block *ob)
struct lto_output_stream *header_stream;
section_name = lto_get_section_name (ob->section_type, NULL);
- lto_begin_section (section_name);
+ lto_begin_section (section_name, !flag_wpa);
free (section_name);
/* Write the header which says how to decode the pieces of the
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 10adfebafc1..f9397699572 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1780,7 +1780,7 @@ produce_asm (struct output_block *ob, tree fn)
else
section_name = lto_get_section_name (section_type, NULL);
- lto_begin_section (section_name);
+ lto_begin_section (section_name, !flag_wpa);
free (section_name);
/* The entire header is stream computed here. */
@@ -2004,7 +2004,7 @@ copy_function (struct cgraph_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);
+ lto_begin_section (section_name, !flag_wpa);
free (section_name);
/* We may have renamed the declaration, e.g., a static function. */
@@ -2402,7 +2402,7 @@ produce_symtab (struct lto_streamer_cache_d *cache)
char *section_name = lto_get_section_name (LTO_section_symtab, NULL);
bitmap seen;
- lto_begin_section (section_name);
+ lto_begin_section (section_name, false);
free (section_name);
seen = lto_bitmap_alloc ();
@@ -2444,7 +2444,7 @@ produce_asm_for_decls (cgraph_node_set set)
memset (&header, 0, sizeof (struct lto_decl_header));
section_name = lto_get_section_name (LTO_section_decls, NULL);
- lto_begin_section (section_name);
+ lto_begin_section (section_name, !flag_wpa);
free (section_name);
/* Make string 0 be a NULL string. */
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index afe7e548981..a8ec41fafc7 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -733,7 +733,7 @@ extern hashval_t lto_hash_decl_slot_node (const void *);
extern int lto_eq_decl_slot_node (const void *, const void *);
extern hashval_t lto_hash_type_slot_node (const void *);
extern int lto_eq_type_slot_node (const void *, const void *);
-extern void lto_begin_section (const char *);
+extern void lto_begin_section (const char *, bool);
extern void lto_end_section (void);
extern void lto_write_stream (struct lto_output_stream *);
extern void lto_output_1_stream (struct lto_output_stream *, char);