Commit f8e9fc30 by Arnaud Charlet

[multiple changes]

2011-09-06  Ed Schonberg  <schonberg@adacore.com>

	* lib-xref.adb (OK_To_Set_Referenced): A reference to a formal
	in a parameter association must not set the Referenced flag on
	the formal.
	* prj-nmsc.adb (Check_File_Naming_Schemes): Remove useless formal

2011-09-06  Hristian Kirtchev  <kirtchev@adacore.com>

	* gnat_rm.texi: Add a section on attribute Descriptor_Size

From-SVN: r178587
parent e8e38f35
2011-09-06 Ed Schonberg <schonberg@adacore.com>
* lib-xref.adb (OK_To_Set_Referenced): A reference to a formal
in a parameter association must not set the Referenced flag on
the formal.
* prj-nmsc.adb (Check_File_Naming_Schemes): Remove useless formal
2011-09-06 Hristian Kirtchev <kirtchev@adacore.com>
* gnat_rm.texi: Add a section on attribute Descriptor_Size
2011-09-06 Arnaud Charlet <charlet@adacore.com> 2011-09-06 Arnaud Charlet <charlet@adacore.com>
* gcc-interface/Makefile.in (common-tools, gnatmake-re, * gcc-interface/Makefile.in (common-tools, gnatmake-re,
......
...@@ -236,6 +236,7 @@ Implementation Defined Attributes ...@@ -236,6 +236,7 @@ Implementation Defined Attributes
* Compiler_Version:: * Compiler_Version::
* Code_Address:: * Code_Address::
* Default_Bit_Order:: * Default_Bit_Order::
* Descriptor_Size::
* Elaborated:: * Elaborated::
* Elab_Body:: * Elab_Body::
* Elab_Spec:: * Elab_Spec::
...@@ -5718,6 +5719,7 @@ consideration, you should minimize the use of these attributes. ...@@ -5718,6 +5719,7 @@ consideration, you should minimize the use of these attributes.
* Compiler_Version:: * Compiler_Version::
* Code_Address:: * Code_Address::
* Default_Bit_Order:: * Default_Bit_Order::
* Descriptor_Size::
* Elaborated:: * Elaborated::
* Elab_Body:: * Elab_Body::
* Elab_Spec:: * Elab_Spec::
...@@ -5932,6 +5934,29 @@ as a @code{Pos} value (0 for @code{High_Order_First}, 1 for ...@@ -5932,6 +5934,29 @@ 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 Descriptor_Size
@unnumberedsec Descriptor_Size
@cindex Descriptor
@cindex Dope vector
@findex Descriptor_Size
@noindent
Attribute @code{Descriptor_Size} returns the size in bits of the descriptor
allocated for an unconstrained array type. An array descriptor contains bounds
information and is located immediately before the first element of the array.
The value of attribute @code{Descriptor_Size} is of type universal integer.
@smallexample @c ada
type Unconstr_Array is array (Positive range <>) of Boolean;
Put_Line ("Descriptor size = " & Unconstr_Array'Descriptor_Size'Img);
@end smallexample
@noindent
The attribute takes into account any additional padding due to type alignment.
In the example above, the descriptor contains two values of type
@code{Positive} representing the low and high bound. Since @code{Positive} has
a size of 31 bits and an alignment of 4, the descriptor size is @code{2 *
Positive'Size + 2} or 64 bits.
@node Elaborated @node Elaborated
@unnumberedsec Elaborated @unnumberedsec Elaborated
@findex Elaborated @findex Elaborated
......
...@@ -512,6 +512,16 @@ package body Lib.Xref is ...@@ -512,6 +512,16 @@ package body Lib.Xref is
return False; return False;
end if; end if;
end if; end if;
-- A reference to a formal in a named parameter association does
-- not make the formal referenced. Formals that are unused in the
-- subprogram body are properly flagged as such, even if calls
-- elsewhere use named notation.
elsif Nkind (P) = N_Parameter_Association
and then N = Selector_Name (P)
then
return False;
end if; end if;
end if; end if;
......
...@@ -376,8 +376,7 @@ package body Prj.Nmsc is ...@@ -376,8 +376,7 @@ package body Prj.Nmsc is
-- otherwise only those currently set in the Source_Names hash table. -- otherwise only those currently set in the Source_Names hash table.
procedure Check_File_Naming_Schemes procedure Check_File_Naming_Schemes
(In_Tree : Project_Tree_Ref; (Project : Project_Processing_Data;
Project : Project_Processing_Data;
File_Name : File_Name_Type; File_Name : File_Name_Type;
Alternate_Languages : out Language_List; Alternate_Languages : out Language_List;
Language : out Language_Ptr; Language : out Language_Ptr;
...@@ -6619,8 +6618,7 @@ package body Prj.Nmsc is ...@@ -6619,8 +6618,7 @@ package body Prj.Nmsc is
------------------------------- -------------------------------
procedure Check_File_Naming_Schemes procedure Check_File_Naming_Schemes
(In_Tree : Project_Tree_Ref; (Project : Project_Processing_Data;
Project : Project_Processing_Data;
File_Name : File_Name_Type; File_Name : File_Name_Type;
Alternate_Languages : out Language_List; Alternate_Languages : out Language_List;
Language : out Language_Ptr; Language : out Language_Ptr;
...@@ -6923,8 +6921,7 @@ package body Prj.Nmsc is ...@@ -6923,8 +6921,7 @@ package body Prj.Nmsc is
if Check_Name then if Check_Name then
Check_File_Naming_Schemes Check_File_Naming_Schemes
(In_Tree => Data.Tree, (Project => Project,
Project => Project,
File_Name => File_Name, File_Name => File_Name,
Alternate_Languages => Alternate_Languages, Alternate_Languages => Alternate_Languages,
Language => Language, Language => Language,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment