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
This commit is contained in:
Ed Schonberg 2014-07-29 14:09:38 +00:00 committed by Arnaud Charlet
parent 422e02cfdf
commit ad8bd3f47c
3 changed files with 42 additions and 28 deletions

View File

@ -1,3 +1,10 @@
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.
2014-07-29 Thomas Quinot <quinot@adacore.com> 2014-07-29 Thomas Quinot <quinot@adacore.com>
* sem_ch3.adb (Constrain_Corresponding_Record): For the case * sem_ch3.adb (Constrain_Corresponding_Record): For the case

View File

@ -347,9 +347,7 @@ Implementation Defined Attributes
* Attribute Bit_Position:: * Attribute Bit_Position::
* Attribute Code_Address:: * Attribute Code_Address::
* Attribute Compiler_Version:: * Attribute Compiler_Version::
* Attribute Constant_Indexing::
* Attribute Default_Bit_Order:: * Attribute Default_Bit_Order::
* Attribute Default_Iterator::
* Attribute Descriptor_Size:: * Attribute Descriptor_Size::
* Attribute Elaborated:: * Attribute Elaborated::
* Attribute Elab_Body:: * Attribute Elab_Body::
@ -370,7 +368,6 @@ Implementation Defined Attributes
* Attribute Integer_Value:: * Attribute Integer_Value::
* Attribute Invalid_Value:: * Attribute Invalid_Value::
* Attribute Iterable:: * Attribute Iterable::
* Attribute Iterator_Element::
* Attribute Large:: * Attribute Large::
* Attribute Library_Level:: * Attribute Library_Level::
* Attribute Lock_Free:: * Attribute Lock_Free::
@ -8560,9 +8557,7 @@ consideration, you should minimize the use of these attributes.
* Attribute Bit_Position:: * Attribute Bit_Position::
* Attribute Code_Address:: * Attribute Code_Address::
* Attribute Compiler_Version:: * Attribute Compiler_Version::
* Attribute Constant_Indexing::
* Attribute Default_Bit_Order:: * Attribute Default_Bit_Order::
* Attribute Default_Iterator::
* Attribute Descriptor_Size:: * Attribute Descriptor_Size::
* Attribute Elaborated:: * Attribute Elaborated::
* Attribute Elab_Body:: * Attribute Elab_Body::
@ -8582,7 +8577,6 @@ consideration, you should minimize the use of these attributes.
* Attribute Implicit_Dereference:: * Attribute Implicit_Dereference::
* Attribute Integer_Value:: * Attribute Integer_Value::
* Attribute Invalid_Value:: * Attribute Invalid_Value::
* Attribute Iterator_Element::
* Attribute Iterable:: * Attribute Iterable::
* Attribute Large:: * Attribute Large::
* Attribute Library_Level:: * Attribute Library_Level::
@ -8697,7 +8691,11 @@ Language Reference Manual}, section 9.12a.
@unnumberedsec Attribute Atomic_Always_Lock_Free @unnumberedsec Attribute Atomic_Always_Lock_Free
@findex Atomic_Always_Lock_Free @findex Atomic_Always_Lock_Free
@noindent @noindent
PLEASE ADD DOCUMENTATION HERE???
The prefix of the @code{Atomic_Always_Lock_Free} attribute is a type.
The result is a Boolean value which is True if the type has discriminants,
and False otherwise. The result indicate whether atomic operations are
supported by the target for the given type.
@node Attribute Bit @node Attribute Bit
@unnumberedsec Attribute Bit @unnumberedsec Attribute Bit
@ -8795,12 +8793,6 @@ prefix) yields a static string identifying the version of the compiler
being used to compile the unit containing the attribute reference. A being used to compile the unit containing the attribute reference. A
typical result would be something like "@value{EDITION} @value{gnat_version} (20090221)". typical result would be something like "@value{EDITION} @value{gnat_version} (20090221)".
@node Attribute Constant_Indexing
@unnumberedsec Attribute Constant_Indexing
@findex Constant_Indexing
@noindent
PLEASE ADD DOCUMENTATION HERE???
@node Attribute Default_Bit_Order @node Attribute Default_Bit_Order
@unnumberedsec Attribute Default_Bit_Order @unnumberedsec Attribute Default_Bit_Order
@cindex Big endian @cindex Big endian
@ -8813,12 +8805,6 @@ as a @code{Pos} value (0 for @code{High_Order_First}, 1 for
@code{Low_Order_First}). This is used to construct the definition of @code{Low_Order_First}). This is used to construct the definition of
@code{Default_Bit_Order} in package @code{System}. @code{Default_Bit_Order} in package @code{System}.
@node Attribute Default_Iterator
@unnumberedsec Attribute Default_Iterator
@findex Default_Iterator
@noindent
PLEASE ADD DOCUMENTATION HERE???
@node Attribute Descriptor_Size @node Attribute Descriptor_Size
@unnumberedsec Attribute Descriptor_Size @unnumberedsec Attribute Descriptor_Size
@cindex Descriptor @cindex Descriptor
@ -9125,12 +9111,6 @@ uninitialized value of the type if pragma Initialize_Scalars is used,
including the ability to modify the value with the binder -Sxx flag and including the ability to modify the value with the binder -Sxx flag and
relevant environment variables at run time. relevant environment variables at run time.
@node Attribute Iterator_Element
@unnumberedsec Attribute Iterator_Element
@findex Iterator_Element
@noindent
PLEASE ADD DOCUMENTATION HERE???
@node Attribute Iterable @node Attribute Iterable
@unnumberedsec Attribute Iterable @unnumberedsec Attribute Iterable
@findex Iterable @findex Iterable

View File

@ -1893,12 +1893,18 @@ package body Lib.Xref is
procedure Check_Type_Reference procedure Check_Type_Reference
(Ent : Entity_Id; (Ent : Entity_Id;
List_Interface : Boolean); List_Interface : Boolean;
Is_Component : Boolean := False);
-- Find whether there is a meaningful type reference for -- Find whether there is a meaningful type reference for
-- Ent, and display it accordingly. If List_Interface is -- Ent, and display it accordingly. If List_Interface is
-- true, then Ent is a progenitor interface of the current -- true, then Ent is a progenitor interface of the current
-- type entity being listed. In that case list it as is, -- 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); procedure Output_Instantiation_Refs (Loc : Source_Ptr);
-- Recursive procedure to output instantiation references for -- Recursive procedure to output instantiation references for
@ -1915,7 +1921,8 @@ package body Lib.Xref is
procedure Check_Type_Reference procedure Check_Type_Reference
(Ent : Entity_Id; (Ent : Entity_Id;
List_Interface : Boolean) List_Interface : Boolean;
Is_Component : Boolean := False)
is is
begin begin
if List_Interface then if List_Interface then
@ -1927,6 +1934,13 @@ package body Lib.Xref is
Left := '<'; Left := '<';
Right := '>'; Right := '>';
-- The following is not documented in lib-xref.ads ???
elsif Is_Component then
Tref := Ent;
Left := '(';
Right := ')';
else else
Get_Type_Reference (Ent, Tref, Left, Right); Get_Type_Reference (Ent, Tref, Left, Right);
end if; end if;
@ -2515,8 +2529,21 @@ package body Lib.Xref is
if Is_Array_Type (XE.Key.Ent) then if Is_Array_Type (XE.Key.Ent) then
declare declare
A_Typ : constant Entity_Id := XE.Key.Ent;
Indx : Node_Id; Indx : Node_Id;
begin 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); Indx := First_Index (XE.Key.Ent);
while Present (Indx) loop while Present (Indx) loop
Check_Type_Reference Check_Type_Reference