public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-198] [Ada] Fully qualify name in JSON representation info
@ 2022-05-09  9:32 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-09  9:32 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ebbe48015e6070b0f020fa57c7eb7fce554e71d4

commit r13-198-gebbe48015e6070b0f020fa57c7eb7fce554e71d4
Author: Etienne Servais <servais@adacore.com>
Date:   Mon Jan 17 16:26:00 2022 +0100

    [Ada] Fully qualify name in JSON representation info
    
    The current termination condition of the recursion is wrong.  When in
    JSON mode, names should be fully qualified. This requires to stop not at
    the first encountered compilation unit but to recurse up to Standard.
    
    gcc/ada/
    
            * repinfo.adb (List_Name): Rework termination condition.

Diff:
---
 gcc/ada/repinfo.adb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
index b77ff4aba5d..ed7312c0f94 100644
--- a/gcc/ada/repinfo.adb
+++ b/gcc/ada/repinfo.adb
@@ -44,6 +44,7 @@ with Sinfo.Nodes;    use Sinfo.Nodes;
 with Sinfo.Utils;    use Sinfo.Utils;
 with Sinput;         use Sinput;
 with Snames;         use Snames;
+with Stand;          use Stand;
 with Stringt;        use Stringt;
 with Table;
 with Ttypes;
@@ -874,10 +875,11 @@ package body Repinfo is
       C : Character;
 
    begin
-      --  List the qualified name recursively, except
-      --  at compilation unit level in default mode.
+      --  In JSON mode, we recurse up to Standard. This is also valid in
+      --  default mode where we recurse up to the first compilation unit and
+      --  should not get to Standard.
 
-      if Is_Compilation_Unit (Ent) then
+      if Scope (Ent) = Standard_Standard then
          null;
       elsif not Is_Compilation_Unit (Scope (Ent))
         or else List_Representation_Info_To_JSON


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-09  9:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09  9:32 [gcc r13-198] [Ada] Fully qualify name in JSON representation info Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).