From b348c78aa4ab72ea533a01ad24311f45b0b4f4cb Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 31 Jul 2018 21:19:25 +0000 Subject: Save discriminator info for LTO for gcc/ChangeLog * gimple-streamer-in.c (input_bb): Restore BB discriminator. * gimple-streamer-out.c (output_bb): Save it. * lto-streamer-in.c (input_struct_function_base): Restore instance discriminator if available. Create map on demand. * lto-streamer-out.c (output_struct_function_base): Save it if available. * final.c (decl_to_instance_map): Document LTO strategy. From-SVN: r263183 --- gcc/lto-streamer-out.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/lto-streamer-out.c') diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 78b90e7..9e28d67 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -2038,6 +2038,14 @@ output_struct_function_base (struct output_block *ob, struct function *fn) stream_output_location (ob, &bp, fn->function_start_locus); stream_output_location (ob, &bp, fn->function_end_locus); + /* Save the instance discriminator if present. */ + int *instance_number_p = NULL; + if (decl_to_instance_map) + instance_number_p = decl_to_instance_map->get (fn->decl); + bp_pack_value (&bp, !!instance_number_p, 1); + if (instance_number_p) + bp_pack_value (&bp, *instance_number_p, sizeof (int) * CHAR_BIT); + streamer_write_bitpack (&bp); } -- cgit v1.1