aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-18 11:29:54 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-18 11:29:54 +0200
commit6907542db49aa9d73dcfe4a991bac455b1818953 (patch)
treef9b4e0397263795900a2a5e40576976a075bf65b
parent3f433bc07ebc9821a4edeea9ecfa3ea94b0b00d1 (diff)
downloadgcc-6907542db49aa9d73dcfe4a991bac455b1818953.zip
gcc-6907542db49aa9d73dcfe4a991bac455b1818953.tar.gz
gcc-6907542db49aa9d73dcfe4a991bac455b1818953.tar.bz2
[multiple changes]
2014-07-18 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Try_Container_Indexing): Refine previous patch for indexing over containers that are derived types: check whether signature of found operation has the correct first parameter before retrieving directly a primitive operation. 2014-07-18 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute, case 'Update): Set Do_Range_Check flag on dynamic bounds of a range used in a component association in the argument of Update. 2014-07-18 Thomas Quinot <quinot@adacore.com> * adaint.c: #define _REENTRANT and _THREAD_SAFE in order for accesses to errno(3) to be thread safe. 2014-07-18 Vincent Celier <celier@adacore.com> * prj-tree.adb (Imported_Or_Extended_Project_Of): For each non limited imported project that is an extending project, return a project being extended if it has the expected name. 2014-07-18 Pascal Obry <obry@adacore.com> * s-os_lib.ads, s-os_lib.adb (Set_File_Last_Modify_Time_Stamp): New routine to set the last modification time stamp for the given file. * gnatchop.adb (File_Time_Stamp): Removed. (Write_Unit): Use Set_File_Last_Modify_Time_Stamp instead of ad-hoc implementation. From-SVN: r212787
-rw-r--r--gcc/ada/ChangeLog32
-rw-r--r--gcc/ada/adaint.c4
-rw-r--r--gcc/ada/gnatchop.adb19
-rw-r--r--gcc/ada/prj-tree.adb15
-rw-r--r--gcc/ada/s-os_lib.adb14
-rw-r--r--gcc/ada/s-os_lib.ads4
-rw-r--r--gcc/ada/sem_attr.adb18
-rw-r--r--gcc/ada/sem_ch4.adb17
8 files changed, 94 insertions, 29 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index cb343c8..7321d41 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,37 @@
2014-07-18 Ed Schonberg <schonberg@adacore.com>
+ * sem_ch4.adb (Try_Container_Indexing): Refine previous patch for
+ indexing over containers that are derived types: check whether
+ signature of found operation has the correct first parameter
+ before retrieving directly a primitive operation.
+
+2014-07-18 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_attr.adb (Analyze_Attribute, case 'Update): Set
+ Do_Range_Check flag on dynamic bounds of a range used in a
+ component association in the argument of Update.
+
+2014-07-18 Thomas Quinot <quinot@adacore.com>
+
+ * adaint.c: #define _REENTRANT and _THREAD_SAFE in order for
+ accesses to errno(3) to be thread safe.
+
+2014-07-18 Vincent Celier <celier@adacore.com>
+
+ * prj-tree.adb (Imported_Or_Extended_Project_Of): For each non
+ limited imported project that is an extending project, return
+ a project being extended if it has the expected name.
+
+2014-07-18 Pascal Obry <obry@adacore.com>
+
+ * s-os_lib.ads, s-os_lib.adb (Set_File_Last_Modify_Time_Stamp): New
+ routine to set the last modification time stamp for the given file.
+ * gnatchop.adb (File_Time_Stamp): Removed.
+ (Write_Unit): Use
+ Set_File_Last_Modify_Time_Stamp instead of ad-hoc implementation.
+
+2014-07-18 Ed Schonberg <schonberg@adacore.com>
+
* sem_aggr.adb (Aggregate_Constraint_Checks): Moved to sem_util.
* sem_util.ads, sem_util.adb (Aggregate_Constraint_Checks):
Moved here, so it can be shared with the resolution of 'Update,
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index a3829f7..607ba82 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -34,6 +34,10 @@
package Osint. Many of the subprograms in OS_Lib import standard
library calls directly. This file contains all other routines. */
+/* Ensure accesses to errno are thread safe. */
+#define _REENTRANT
+#define _THREAD_SAFE
+
#ifdef __vxworks
/* No need to redefine exit here. */
diff --git a/gcc/ada/gnatchop.adb b/gcc/ada/gnatchop.adb
index 3d953a2..d51e83a 100644
--- a/gcc/ada/gnatchop.adb
+++ b/gcc/ada/gnatchop.adb
@@ -209,10 +209,6 @@ procedure Gnatchop is
procedure Error_Msg (Message : String; Warning : Boolean := False);
-- Produce an error message on standard error output
- procedure File_Time_Stamp (Name : C_File_Name; Time : OS_Time);
- -- Given the name of a file or directory, Name, set the
- -- time stamp. This function must be used for an unopened file.
-
function Files_Exist return Boolean;
-- Check Unit.Table for possible file names that already exist
-- in the file system. Returns true if files exist, False otherwise
@@ -372,18 +368,6 @@ procedure Gnatchop is
end if;
end Error_Msg;
- ---------------------
- -- File_Time_Stamp --
- ---------------------
-
- procedure File_Time_Stamp (Name : C_File_Name; Time : OS_Time) is
- procedure Set_File_Time (Name : C_File_Name; Time : OS_Time);
- pragma Import (C, Set_File_Time, "__gnat_set_file_time_name");
-
- begin
- Set_File_Time (Name, Time);
- end File_Time_Stamp;
-
-----------------
-- Files_Exist --
-----------------
@@ -1708,7 +1692,6 @@ procedure Gnatchop is
declare
E_Name : constant String := OS_Name (1 .. O_Length);
- C_Name : aliased constant String := E_Name & ASCII.NUL;
OS_Encoding : constant String := Encoding (1 .. E_Length);
File : Stream_IO.File_Type;
@@ -1776,7 +1759,7 @@ procedure Gnatchop is
Stream_IO.Close (File);
if Preserve_Mode then
- File_Time_Stamp (C_Name'Address, TS_Time);
+ Set_File_Last_Modify_Time_Stamp (E_Name, TS_Time);
end if;
end;
end Write_Unit;
diff --git a/gcc/ada/prj-tree.adb b/gcc/ada/prj-tree.adb
index 37ec38f..e4a2360 100644
--- a/gcc/ada/prj-tree.adb
+++ b/gcc/ada/prj-tree.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1134,8 +1134,17 @@ package body Prj.Tree is
-- of variable or attributes.
Result := Non_Limited_Project_Node_Of (With_Clause, In_Tree);
- exit when Present (Result)
- and then Name_Of (Result, In_Tree) = With_Name;
+
+ while Present (Result) loop
+ if Name_Of (Result, In_Tree) = With_Name then
+ return Result;
+ end if;
+
+ Result :=
+ Extended_Project_Of
+ (Project_Declaration_Of (Result, In_Tree), In_Tree);
+ end loop;
+
With_Clause := Next_With_Clause_Of (With_Clause, In_Tree);
end loop;
diff --git a/gcc/ada/s-os_lib.adb b/gcc/ada/s-os_lib.adb
index 6669b42..17ac32e 100644
--- a/gcc/ada/s-os_lib.adb
+++ b/gcc/ada/s-os_lib.adb
@@ -2385,6 +2385,20 @@ package body System.OS_Lib is
C_Set_Executable (C_Name (C_Name'First)'Address, Mode);
end Set_Executable;
+ -------------------------------------
+ -- Set_File_Last_Modify_Time_Stamp --
+ -------------------------------------
+
+ procedure Set_File_Last_Modify_Time_Stamp (Name : String; Time : OS_Time) is
+ procedure C_Set_File_Time (Name : C_File_Name; Time : OS_Time);
+ pragma Import (C, C_Set_File_Time, "__gnat_set_file_time_name");
+ C_Name : aliased String (Name'First .. Name'Last + 1);
+ begin
+ C_Name (Name'Range) := Name;
+ C_Name (C_Name'Last) := ASCII.NUL;
+ C_Set_File_Time (C_Name'Address, Time);
+ end Set_File_Last_Modify_Time_Stamp;
+
----------------------
-- Set_Non_Readable --
----------------------
diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads
index 014f114..9552d86 100644
--- a/gcc/ada/s-os_lib.ads
+++ b/gcc/ada/s-os_lib.ads
@@ -384,6 +384,10 @@ package System.OS_Lib is
-- Note: this procedure is not supported on VMS and VxWorks 5. On these
-- platforms, Success is always set to False.
+ procedure Set_File_Last_Modify_Time_Stamp (Name : String; Time : OS_Time);
+ -- Given the name of a file or directory, Name, set the last modification
+ -- time stamp. This function must be used for an unopened file.
+
function Read
(FD : File_Descriptor;
A : System.Address;
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 5326490..e65fecd 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -6314,6 +6314,7 @@ package body Sem_Attr is
declare
Index : Node_Id;
Index_Type : Entity_Id;
+ Lo, Hi : Node_Id;
begin
if Nkind (First (Choices (Assoc))) /= N_Aggregate then
@@ -6331,11 +6332,18 @@ package body Sem_Attr is
Index := First (Choices (Assoc));
while Present (Index) loop
if Nkind (Index) = N_Range then
- Analyze_And_Resolve
- (Low_Bound (Index), Etype (Index_Type));
- Analyze_And_Resolve
- (High_Bound (Index), Etype (Index_Type));
- Set_Etype (Index, Etype (Index_Type));
+ Lo := Low_Bound (Index);
+ Hi := High_Bound (Index);
+
+ Analyze_And_Resolve (Lo, Etype (Index_Type));
+ if not Is_OK_Static_Expression (Lo) then
+ Set_Do_Range_Check (Lo);
+ end if;
+
+ Analyze_And_Resolve (Hi, Etype (Index_Type));
+ if not Is_OK_Static_Expression (Hi) then
+ Set_Do_Range_Check (Hi);
+ end if;
else
Analyze_And_Resolve (Index, Etype (Index_Type));
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 6d0db7d..ab7a10d 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -7021,13 +7021,24 @@ package body Sem_Ch4 is
return False;
end if;
- -- If the container type is a derived type, the value of the inherited
- -- aspect is the Reference operation declared for the parent type.
+ -- If the container type is derived from another container type, the
+ -- value of the inherited aspect is the Reference operation declared
+ -- for the parent type.
+
-- However, Reference is also a primitive operation of the type, and
-- the inherited operation has a different signature. We retrieve the
-- right one from the list of primitive operations of the derived type.
- elsif Is_Derived_Type (Etype (Prefix)) then
+ -- Note that predefined containers are typically all derived from one
+ -- of the Controlled types. The code below is motivated by containers
+ -- that are derived from other types with a Reference aspect.
+
+ -- Additional machinery may be needed for types that have several user-
+ -- defined Reference operations with different signatures ???
+
+ elsif Is_Derived_Type (Etype (Prefix))
+ and then Etype (First_Formal (Entity (Func_Name))) /= Etype (Prefix)
+ then
Func := Find_Prim_Op (Etype (Prefix), Chars (Func_Name));
Func_Name := New_Occurrence_Of (Func, Loc);
end if;