aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-06-26 11:09:51 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-06-26 11:09:51 +0000
commit6ab601efaa82b47e0ea1d3c4b14e052b07c79280 (patch)
treec69a4e5e8886fff358741931c089bdb0b7336a6c /gcc/lto-streamer-out.c
parent7cfb7260526af8cc8f8d416dcde0f8f8d397eb37 (diff)
downloadgcc-6ab601efaa82b47e0ea1d3c4b14e052b07c79280.zip
gcc-6ab601efaa82b47e0ea1d3c4b14e052b07c79280.tar.gz
gcc-6ab601efaa82b47e0ea1d3c4b14e052b07c79280.tar.bz2
lto-streamer.h (lto_bitmap_alloc): Remove.
2019-06-26 Richard Biener <rguenther@suse.de> * lto-streamer.h (lto_bitmap_alloc): Remove. (lto_bitmap_free): Likewise. * lto-streamer.c (lto_bitmap_alloc): Remove. (lto_bitmap_free): Likewise. (lto_obstack): Likewise. (lto_obstack_initialized): Likewise. * lto-streamer-out.c (lto_output): Use own obstack for local bitmap, free it consistently. From-SVN: r272687
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 294771d..dc68429 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -2397,13 +2397,17 @@ lto_output (void)
{
struct lto_out_decl_state *decl_state;
bitmap output = NULL;
+ bitmap_obstack output_obstack;
int i, n_nodes;
lto_symtab_encoder_t encoder = lto_get_out_decl_state ()->symtab_node_encoder;
prune_offload_funcs ();
if (flag_checking)
- output = lto_bitmap_alloc ();
+ {
+ bitmap_obstack_initialize (&output_obstack);
+ output = BITMAP_ALLOC (&output_obstack);
+ }
/* Initialize the streamer. */
lto_streamer_init ();
@@ -2419,10 +2423,7 @@ lto_output (void)
&& !node->alias)
{
if (flag_checking)
- {
- gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
- bitmap_set_bit (output, DECL_UID (node->decl));
- }
+ gcc_assert (bitmap_set_bit (output, DECL_UID (node->decl)));
decl_state = lto_new_out_decl_state ();
lto_push_out_decl_state (decl_state);
if (gimple_has_body_p (node->decl)
@@ -2452,10 +2453,7 @@ lto_output (void)
{
timevar_push (TV_IPA_LTO_CTORS_OUT);
if (flag_checking)
- {
- gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
- bitmap_set_bit (output, DECL_UID (node->decl));
- }
+ gcc_assert (bitmap_set_bit (output, DECL_UID (node->decl)));
decl_state = lto_new_out_decl_state ();
lto_push_out_decl_state (decl_state);
if (DECL_INITIAL (node->decl) != error_mark_node
@@ -2480,9 +2478,11 @@ lto_output (void)
output_offload_tables ();
-#if CHECKING_P
- lto_bitmap_free (output);
-#endif
+ if (flag_checking)
+ {
+ BITMAP_FREE (output);
+ bitmap_obstack_release (&output_obstack);
+ }
}
/* Write each node in encoded by ENCODER to OB, as well as those reachable