aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-10-12 12:38:39 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-12 12:38:39 +0200
commit7730df143ca83fef65f64299856c8072bf21a453 (patch)
tree15546ab6dcc6d4203794b6884877c87ebe68aa07
parentc775c2094bfdd9b85ad67e451a3fe690780e84d4 (diff)
downloadgcc-7730df143ca83fef65f64299856c8072bf21a453.zip
gcc-7730df143ca83fef65f64299856c8072bf21a453.tar.gz
gcc-7730df143ca83fef65f64299856c8072bf21a453.tar.bz2
[multiple changes]
2010-10-12 Thomas Quinot <quinot@adacore.com> * a-exetim.ads: Minor reformatting. * g-socket.ads (Port_Type): Better definition corresponding to the actual standard range. * exp_ch5.adb: Add comment. * sem_aux.adb: Minor reformatting. 2010-10-12 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Copy_Generic_Node): If node is a string literal, remove string_literal_subtype so that a new one can be constructed in the scope of the instance. From-SVN: r165357
-rw-r--r--gcc/ada/ChangeLog14
-rw-r--r--gcc/ada/a-exetim.ads4
-rw-r--r--gcc/ada/exp_ch5.adb1
-rw-r--r--gcc/ada/g-socket.ads56
-rwxr-xr-xgcc/ada/sem_aux.adb3
-rw-r--r--gcc/ada/sem_ch12.adb20
6 files changed, 62 insertions, 36 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f267703..b473f21 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-12 Thomas Quinot <quinot@adacore.com>
+
+ * a-exetim.ads: Minor reformatting.
+ * g-socket.ads (Port_Type): Better definition corresponding to the
+ actual standard range.
+ * exp_ch5.adb: Add comment.
+ * sem_aux.adb: Minor reformatting.
+
+2010-10-12 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch12.adb (Copy_Generic_Node): If node is a string literal, remove
+ string_literal_subtype so that a new one can be constructed in the
+ scope of the instance.
+
2010-10-12 Robert Dewar <dewar@adacore.com>
* exp_ch9.adb (Has_Pragma_Priority): New name for Has_Priority_Pragma
diff --git a/gcc/ada/a-exetim.ads b/gcc/ada/a-exetim.ads
index c4b4577..c4b8ba2 100644
--- a/gcc/ada/a-exetim.ads
+++ b/gcc/ada/a-exetim.ads
@@ -37,8 +37,8 @@ package Ada.Execution_Time is
CPU_Tick : constant Ada.Real_Time.Time_Span;
function Clock
- (T : Ada.Task_Identification.Task_Id
- := Ada.Task_Identification.Current_Task)
+ (T : Ada.Task_Identification.Task_Id :=
+ Ada.Task_Identification.Current_Task)
return CPU_Time;
function "+"
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 8dbd349..2dbfe349 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -1759,6 +1759,7 @@ package body Exp_Ch5 is
-- has discriminants (necessarily with defaults) a check may still be
-- necessary if the Lhs is aliased. The private determinants must be
-- visible to build the discriminant constraints.
+ -- What is a "determinant"???
-- Only an explicit dereference that comes from source indicates
-- aliasing. Access to formals of protected operations and entries
diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads
index 55330bd..4ff1936 100644
--- a/gcc/ada/g-socket.ads
+++ b/gcc/ada/g-socket.ads
@@ -478,13 +478,14 @@ package GNAT.Sockets is
-- more data can be transmitted. Neither transmission nor reception can be
-- performed with Shut_Read_Write.
- type Port_Type is new Natural;
- -- Classical port definition. No_Port provides a special value to
- -- denote uninitialized port. Any_Port provides a special value
- -- enabling all ports.
+ type Port_Type is range 0 .. 16#ffff#;
+ -- TCP/UDP port number
Any_Port : constant Port_Type;
- No_Port : constant Port_Type;
+ -- All ports
+
+ No_Port : constant Port_Type;
+ -- Uninitialized port number
type Inet_Addr_Type (Family : Family_Type := Family_Inet) is private;
-- An Internet address depends on an address family (IPv4 contains 4 octets
@@ -975,8 +976,8 @@ package GNAT.Sockets is
Count : out Ada.Streams.Stream_Element_Count;
Flags : Request_Flag_Type := No_Request_Flag);
-- Transmit data gathered from the set of vector elements Vector to a
- -- socket. Count is set to the count of transmitted stream elements.
- -- Flags allow control over transmission.
+ -- socket. Count is set to the count of transmitted stream elements. Flags
+ -- allow control over transmission.
procedure Set_Socket_Option
(Socket : Socket_Type;
@@ -987,10 +988,9 @@ package GNAT.Sockets is
procedure Shutdown_Socket
(Socket : Socket_Type;
How : Shutmode_Type := Shut_Read_Write);
- -- Shutdown a connected socket. If How is Shut_Read, further receives will
- -- be disallowed. If How is Shut_Write, further sends will be disallowed.
- -- If how is Shut_Read_Write, further sends and receives will be
- -- disallowed.
+ -- Shutdown a connected socket. If How is Shut_Read further receives will
+ -- be disallowed. If How is Shut_Write further sends will be disallowed.
+ -- If How is Shut_Read_Write further sends and receives will be disallowed.
type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class;
-- Same interface as Ada.Streams.Stream_IO
@@ -1010,9 +1010,9 @@ package GNAT.Sockets is
procedure Free is new Ada.Unchecked_Deallocation
(Ada.Streams.Root_Stream_Type'Class, Stream_Access);
- -- Destroy a stream created by one of the Stream functions above,
- -- releasing the corresponding resources. The user is responsible for
- -- calling this subprogram when the stream is not needed anymore.
+ -- Destroy a stream created by one of the Stream functions above, releasing
+ -- the corresponding resources. The user is responsible for calling this
+ -- subprogram when the stream is not needed anymore.
type Socket_Set_Type is limited private;
-- This type allows to manipulate sets of sockets. It allows to wait for
@@ -1058,16 +1058,18 @@ package GNAT.Sockets is
-- can block the full process (not just the calling thread).
--
-- Check_Selector provides the very same behaviour. The only difference is
- -- that it does not watch for exception events. Note that on some
- -- platforms it is kept process blocking on purpose. The timeout parameter
- -- allows the user to have the behaviour he wants. Abort_Selector allows
- -- to safely abort a blocked Check_Selector call. A special socket
- -- is opened by Create_Selector and included in each call to
- -- Check_Selector. Abort_Selector causes an event to occur on this
- -- descriptor in order to unblock Check_Selector. Note that each call to
- -- Abort_Selector will cause exactly one call to Check_Selector to return
- -- with Aborted status. The special socket created by Create_Selector is
- -- closed when Close_Selector is called.
+ -- that it does not watch for exception events. Note that on some platforms
+ -- it is kept process blocking on purpose. The timeout parameter allows the
+ -- user to have the behaviour he wants. Abort_Selector allows to safely
+ -- abort a blocked Check_Selector call. A special socket is opened by
+ -- Create_Selector and included in each call to Check_Selector.
+ --
+ -- Abort_Selector causes an event to occur on this descriptor in order to
+ -- unblock Check_Selector. Note that each call to Abort_Selector will cause
+ -- exactly one call to Check_Selector to return with Aborted status. The
+ -- special socket created by Create_Selector is closed when Close_Selector
+ -- is called.
+ --
-- A typical case where it is useful to abort a Check_Selector operation is
-- the situation where a change to the monitored sockets set must be made.
@@ -1098,9 +1100,9 @@ package GNAT.Sockets is
-- R_Socket_Set and W_Socket_Set (even if they denote the same set of
-- Sockets), or some event may be lost.
--
- -- Socket_Error is raised when the select(2) system call returns an
- -- error condition, or when a read error occurs on the signalling socket
- -- used for the implementation of Abort_Selector.
+ -- Socket_Error is raised when the select(2) system call returns an error
+ -- condition, or when a read error occurs on the signalling socket used for
+ -- the implementation of Abort_Selector.
procedure Check_Selector
(Selector : Selector_Type;
diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb
index 7bda710..656692f 100755
--- a/gcc/ada/sem_aux.adb
+++ b/gcc/ada/sem_aux.adb
@@ -204,8 +204,7 @@ package body Sem_Aux is
begin
pragma Assert
- (Has_Discriminants (Typ)
- or else Has_Unknown_Discriminants (Typ));
+ (Has_Discriminants (Typ) or else Has_Unknown_Discriminants (Typ));
Ent := First_Entity (Typ);
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 69b799d..224636d6 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -6211,15 +6211,25 @@ package body Sem_Ch12 is
end if;
end;
- elsif Nkind_In (N, N_Integer_Literal,
- N_Real_Literal,
- N_String_Literal)
- then
+ elsif Nkind_In (N, N_Integer_Literal, N_Real_Literal) then
+
-- No descendant fields need traversing
null;
- -- For the remaining nodes, copy recursively their descendants
+ elsif Nkind (N) = N_String_Literal
+ and then Present (Etype (N))
+ and then Instantiating
+ then
+ -- If the string is declared in an outer scope, the string_literal
+ -- subtype created for it may have the wrong scope. We force the
+ -- reanalysis of the constant to generate a new itype in the proper
+ -- context.
+
+ Set_Etype (New_N, Empty);
+ Set_Analyzed (New_N, False);
+
+ -- For the remaining nodes, copy their descendants recursively
else
Copy_Descendants;