diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2021-07-24 12:53:39 +0200 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2021-08-11 07:29:27 +0200 |
commit | a45918f8a7444a40eb397a037683ba5900a2db74 (patch) | |
tree | 63e0dc06354de56f4a97cb19df82798a09294bde /gcc | |
parent | fed7c1634e8e50600e20cb97dbfbd74ecbd5ba22 (diff) | |
download | gcc-a45918f8a7444a40eb397a037683ba5900a2db74.zip gcc-a45918f8a7444a40eb397a037683ba5900a2db74.tar.gz gcc-a45918f8a7444a40eb397a037683ba5900a2db74.tar.bz2 |
Ada: Remove debug line number for DECL_IGNORED_P functions
It was pointed out in PR101598 to be inappropriate, that
ignored Ada decls receive the source line number which was
recorded in the function decl's DECL_SOURCE_LOCATION.
Therefore set all front-end-generated Ada decls with
DECL_IGNORED_P to UNKNOWN_LOCATION.
2021-08-11 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR debug/101598
* gcc-interface/trans.c (Subprogram_Body_to_gnu): Set the
DECL_SOURCE_LOCATION of DECL_IGNORED_P gnu_subprog_decl to
UNKNOWN_LOCATION.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index f61183d..3df56aa 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -3885,7 +3885,9 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) } /* Set the line number in the decl to correspond to that of the body. */ - if (!Sloc_to_locus (Sloc (gnat_node), &locus, false, gnu_subprog_decl)) + if (DECL_IGNORED_P (gnu_subprog_decl)) + locus = UNKNOWN_LOCATION; + else if (!Sloc_to_locus (Sloc (gnat_node), &locus, false, gnu_subprog_decl)) locus = input_location; DECL_SOURCE_LOCATION (gnu_subprog_decl) = locus; |