mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-15 06:40:26 +08:00
Simplify LTO section format.
2019-07-22 Martin Liska <mliska@suse.cz> * lto-section-in.c (lto_get_section_data): Use new function get_compression. * lto-streamer-out.c (produce_lto_section): Use set_compression to encode compression algorithm. * lto-streamer.h (struct lto_section): Do not use bitfields in the format. From-SVN: r273661
This commit is contained in:
parent
2df89b66f1
commit
d1caf05a89
@ -1,3 +1,12 @@
|
||||
2019-07-22 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* lto-section-in.c (lto_get_section_data):
|
||||
Use new function get_compression.
|
||||
* lto-streamer-out.c (produce_lto_section): Use
|
||||
set_compression to encode compression algorithm.
|
||||
* lto-streamer.h (struct lto_section): Do not
|
||||
use bitfields in the format.
|
||||
|
||||
2019-07-22 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR driver/91172
|
||||
|
@ -161,7 +161,8 @@ lto_get_section_data (struct lto_file_decl_data *file_data,
|
||||
|
||||
stream = lto_start_uncompression (lto_append_data, &buffer);
|
||||
lto_uncompress_block (stream, data, *len);
|
||||
lto_end_uncompression (stream, file_data->lto_section_header.compression);
|
||||
lto_end_uncompression (stream,
|
||||
file_data->lto_section_header.get_compression ());
|
||||
|
||||
*len = buffer.length - header_length;
|
||||
data = buffer.data + header_length;
|
||||
|
@ -2403,7 +2403,8 @@ produce_lto_section ()
|
||||
|
||||
bool slim_object = flag_generate_lto && !flag_fat_lto_objects;
|
||||
lto_section s
|
||||
= { LTO_major_version, LTO_minor_version, slim_object, compression, 0 };
|
||||
= { LTO_major_version, LTO_minor_version, slim_object, 0 };
|
||||
s.set_compression (compression);
|
||||
lto_write_data (&s, sizeof s);
|
||||
lto_end_section ();
|
||||
destroy_output_block (ob);
|
||||
|
@ -394,9 +394,22 @@ struct lto_section
|
||||
{
|
||||
int16_t major_version;
|
||||
int16_t minor_version;
|
||||
unsigned char slim_object: 1;
|
||||
lto_compression compression: 4;
|
||||
int32_t reserved0: 27;
|
||||
unsigned char slim_object;
|
||||
|
||||
/* Flags is a private field that is not defined publicly. */
|
||||
uint16_t flags;
|
||||
|
||||
/* Set compression to FLAGS. */
|
||||
inline void set_compression (lto_compression c)
|
||||
{
|
||||
flags = c;
|
||||
}
|
||||
|
||||
/* Get compression from FLAGS. */
|
||||
inline lto_compression get_compression ()
|
||||
{
|
||||
return (lto_compression) flags;
|
||||
}
|
||||
};
|
||||
|
||||
STATIC_ASSERT (sizeof (lto_section) == 8);
|
||||
|
Loading…
x
Reference in New Issue
Block a user