aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-09-06 13:03:44 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-09-06 13:03:44 +0200
commitf8e9fc30f7f06af84310ecb982ee8600f62610fb (patch)
tree2d2f91b3a0cd4aed6e03e988e2bd29d877adfeb2
parente8e38f35ff31141dd99c9fe036c226c096a30739 (diff)
downloadgcc-f8e9fc30f7f06af84310ecb982ee8600f62610fb.zip
gcc-f8e9fc30f7f06af84310ecb982ee8600f62610fb.tar.gz
gcc-f8e9fc30f7f06af84310ecb982ee8600f62610fb.tar.bz2
[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
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/gnat_rm.texi25
-rw-r--r--gcc/ada/lib-xref.adb10
-rw-r--r--gcc/ada/prj-nmsc.adb9
4 files changed, 49 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d2bac3e8..da553f8 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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,
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,