aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEtienne Servais <servais@adacore.com>2022-01-17 16:26:00 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-09 09:27:37 +0000
commitebbe48015e6070b0f020fa57c7eb7fce554e71d4 (patch)
treeb2175bcd5f5e610a9fcd1e6fa423b69bdfbe7e9e /gcc
parenta746131d375283f28e6e0a3e45bddffb6d1ebfcd (diff)
downloadgcc-ebbe48015e6070b0f020fa57c7eb7fce554e71d4.zip
gcc-ebbe48015e6070b0f020fa57c7eb7fce554e71d4.tar.gz
gcc-ebbe48015e6070b0f020fa57c7eb7fce554e71d4.tar.bz2
[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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/repinfo.adb8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
index b77ff4a..ed7312c 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