On Jul 24, 2018, Alexandre Oliva <ol...@gnu.org> wrote:

> Ok to install the first two patches?  (the third is just for reference)

Ping?

https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01419.html


> Introduce instance discriminators

> From: Alexandre Oliva <ol...@adacore.com>

> With -gnateS, the Ada compiler sets itself up to output discriminators
> for different instantiations of generics, but the middle and back ends
> have lacked support for that.  This patch introduces the missing bits,
> translating the GNAT-internal representation of the per-file instance
> map to an instance_table that maps decls to instance discriminators.


> From: Alexandre Oliva  <ol...@adacore.com>, Olivier Hainque  
> <hain...@adacore.com>
> for  gcc/ChangeLog

>       * debug.h (decl_to_instance_map_t): New type.
>       (decl_to_instance_map): Declare.
>       (maybe_create_decl_to_instance_map): New inline function.
>       * final.c (bb_discriminator, last_bb_discriminator): New statics,
>       to track basic block discriminators.
>       (final_start_function_1): Initialize them.
>       (final_scan_insn_1): On NOTE_INSN_BASIC_BLOCK, track
>       bb_discriminator.
>       (decl_to_instance_map): New variable.
>       (map_decl_to_instance, maybe_set_discriminator): New functions.
>       (notice_source_line): Set discriminator.

> for  gcc/ada

>       * trans.c: Include debug.h.
>       (file_map): New static variable.
>       (gigi): Set it.  Create decl_to_instance_map when needed.
>       (Subprogram_Body_to_gnu): Pass gnu_subprog_decl to...
>       (Sloc_to_locus): ... this.  Add decl parm, map it to instance.
>       * gigi.h (Sloc_to_locus): Adjust declaration.

> for  gcc/testsuite/ChangeLog

>       * gnat.dg/dinst.adb: New.
>       * gnat.dg/dinst_pkg.ads, gnat.dg/dinst_pkg.adb: New.

[...]

> Save discriminator info for LTO

> From: Alexandre Oliva <ol...@adacore.com>

> 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.


-- 
Alexandre Oliva, freedom fighter   https://FSFLA.org/blogs/lxo
Be the change, be Free!         FSF Latin America board member
GNU Toolchain Engineer                Free Software Evangelist

Reply via email to