OSDN Git Service

2011-09-06 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Sep 2011 11:03:44 +0000 (11:03 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Sep 2011 11:03:44 +0000 (11:03 +0000)
* 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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178587 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gnat_rm.texi
gcc/ada/lib-xref.adb
gcc/ada/prj-nmsc.adb

index d2bac3e..da553f8 100644 (file)
@@ -1,3 +1,14 @@
+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>
 
        * gcc-interface/Makefile.in (common-tools, gnatmake-re,
index 5166058..7680876 100644 (file)
@@ -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
index 0210757..f16e8ab 100644 (file)
@@ -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;
 
index 9193769..8c202a3 100644 (file)
@@ -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,