+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
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;
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);
{
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);