diff options
author | Alexandre Oliva <oliva@adacore.com> | 2018-07-31 21:19:13 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2018-07-31 21:19:13 +0000 |
commit | fa6fd7b7afece6e0cfe197c9419ea3346d3c60b2 (patch) | |
tree | f227c6802b9656b6bc7d3b3f090e9b9d78f1bb4b /gcc/ada/gcc-interface/gigi.h | |
parent | e540ccc0e281a6e30c14e55b39334db27e55b3bf (diff) | |
download | gcc-fa6fd7b7afece6e0cfe197c9419ea3346d3c60b2.zip gcc-fa6fd7b7afece6e0cfe197c9419ea3346d3c60b2.tar.gz gcc-fa6fd7b7afece6e0cfe197c9419ea3346d3c60b2.tar.bz2 |
Introduce instance discriminators
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 <oliva@adacore.com>, Olivier Hainque <hainque@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/ChangeLog
* 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.
Co-Authored-By: Olivier Hainque <hainque@adacore.com>
From-SVN: r263182
Diffstat (limited to 'gcc/ada/gcc-interface/gigi.h')
-rw-r--r-- | gcc/ada/gcc-interface/gigi.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index a75cb90..b890195 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -285,7 +285,7 @@ extern void process_type (Entity_Id gnat_entity); location and false if it doesn't. If CLEAR_COLUMN is true, set the column information to 0. */ extern bool Sloc_to_locus (Source_Ptr Sloc, location_t *locus, - bool clear_column = false); + bool clear_column = false, const_tree decl = 0); /* Post an error message. MSG is the error message, properly annotated. NODE is the node at which to post the error and the node to use for the |