aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2014-07-29 14:09:38 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-29 16:09:38 +0200
commitad8bd3f47cd12be5905dd43d058b3f26319449a2 (patch)
tree2b403545e88cd224334d0259b7f2cfa2d959d5db /gcc/ada/lib-xref.adb
parent422e02cfdf696450410b69d0c6491102ebc2970e (diff)
downloadgcc-ad8bd3f47cd12be5905dd43d058b3f26319449a2.zip
gcc-ad8bd3f47cd12be5905dd43d058b3f26319449a2.tar.gz
gcc-ad8bd3f47cd12be5905dd43d058b3f26319449a2.tar.bz2
lib-xref.adb (Output_Refs, [...]): For a derived array type...
2014-07-29 Ed Schonberg <schonberg@adacore.com> * lib-xref.adb (Output_Refs, Check_Type_Reference): For a derived array type, add information about component type, which was previously missing in ali file. * gnat_rm.texi: Add documentation for Atomic_Always_Lock_Free. From-SVN: r213198
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r--gcc/ada/lib-xref.adb33
1 files changed, 30 insertions, 3 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 95c87ef..8cc8e2f 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -1893,12 +1893,18 @@ package body Lib.Xref is
procedure Check_Type_Reference
(Ent : Entity_Id;
- List_Interface : Boolean);
+ List_Interface : Boolean;
+ Is_Component : Boolean := False);
-- Find whether there is a meaningful type reference for
-- Ent, and display it accordingly. If List_Interface is
-- true, then Ent is a progenitor interface of the current
-- type entity being listed. In that case list it as is,
- -- without looking for a type reference for it.
+ -- without looking for a type reference for it. Flag is also
+ -- used for index types of an array type, where the caller
+ -- supplies the intended type reference. Is_Component serves
+ -- the same purpose, to display the component type of a
+ -- derived array type, for which only the parent type has
+ -- ben displayed so far.
procedure Output_Instantiation_Refs (Loc : Source_Ptr);
-- Recursive procedure to output instantiation references for
@@ -1915,7 +1921,8 @@ package body Lib.Xref is
procedure Check_Type_Reference
(Ent : Entity_Id;
- List_Interface : Boolean)
+ List_Interface : Boolean;
+ Is_Component : Boolean := False)
is
begin
if List_Interface then
@@ -1927,6 +1934,13 @@ package body Lib.Xref is
Left := '<';
Right := '>';
+ -- The following is not documented in lib-xref.ads ???
+
+ elsif Is_Component then
+ Tref := Ent;
+ Left := '(';
+ Right := ')';
+
else
Get_Type_Reference (Ent, Tref, Left, Right);
end if;
@@ -2515,8 +2529,21 @@ package body Lib.Xref is
if Is_Array_Type (XE.Key.Ent) then
declare
+ A_Typ : constant Entity_Id := XE.Key.Ent;
Indx : Node_Id;
+
begin
+ -- If this is a derived array type, we have
+ -- output the parent type, so add the component
+ -- type now.
+
+ if Is_Derived_Type (A_Typ) then
+ Check_Type_Reference
+ (Component_Type (A_Typ), False, True);
+ end if;
+
+ -- Add references to index types.
+
Indx := First_Index (XE.Key.Ent);
while Present (Indx) loop
Check_Type_Reference