From f4bdf45b35828513ebd03ca08d40b853cb93c270 Mon Sep 17 00:00:00 2001 From: charlet Date: Tue, 6 Sep 2011 11:03:44 +0000 Subject: [PATCH] 2011-09-06 Ed Schonberg * 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 * gnat_rm.texi: Add a section on attribute Descriptor_Size git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178587 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 11 +++++++++++ gcc/ada/gnat_rm.texi | 25 +++++++++++++++++++++++++ gcc/ada/lib-xref.adb | 10 ++++++++++ gcc/ada/prj-nmsc.adb | 9 +++------ 4 files changed, 49 insertions(+), 6 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d2bac3e..da553f8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2011-09-06 Ed Schonberg + + * 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 + + * gnat_rm.texi: Add a section on attribute Descriptor_Size + 2011-09-06 Arnaud Charlet * gcc-interface/Makefile.in (common-tools, gnatmake-re, diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 5166058..7680876 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -236,6 +236,7 @@ Implementation Defined Attributes * Compiler_Version:: * Code_Address:: * Default_Bit_Order:: +* Descriptor_Size:: * Elaborated:: * Elab_Body:: * Elab_Spec:: @@ -5718,6 +5719,7 @@ consideration, you should minimize the use of these attributes. * Compiler_Version:: * Code_Address:: * Default_Bit_Order:: +* Descriptor_Size:: * Elaborated:: * Elab_Body:: * Elab_Spec:: @@ -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{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 @unnumberedsec Elaborated @findex Elaborated diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index 0210757..f16e8ab 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -512,6 +512,16 @@ package body Lib.Xref is return False; 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; diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 9193769..8c202a3 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -376,8 +376,7 @@ package body Prj.Nmsc is -- otherwise only those currently set in the Source_Names hash table. procedure Check_File_Naming_Schemes - (In_Tree : Project_Tree_Ref; - Project : Project_Processing_Data; + (Project : Project_Processing_Data; File_Name : File_Name_Type; Alternate_Languages : out Language_List; Language : out Language_Ptr; @@ -6619,8 +6618,7 @@ package body Prj.Nmsc is ------------------------------- procedure Check_File_Naming_Schemes - (In_Tree : Project_Tree_Ref; - Project : Project_Processing_Data; + (Project : Project_Processing_Data; File_Name : File_Name_Type; Alternate_Languages : out Language_List; Language : out Language_Ptr; @@ -6923,8 +6921,7 @@ package body Prj.Nmsc is if Check_Name then Check_File_Naming_Schemes - (In_Tree => Data.Tree, - Project => Project, + (Project => Project, File_Name => File_Name, Alternate_Languages => Alternate_Languages, Language => Language, -- 2.7.4